Unix Programming - access hardware

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > October 2004 > access hardware





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author access hardware
Joseph

2004-10-26, 5:51 pm

Can I use open("/dev/if1"),open("/dev/if2") to read data from if1 and
write data to if2?
Jens.Toerring@physik.fu-berlin.de

2004-10-26, 5:51 pm

Joseph <te0543@giga.net.tw> wrote:
> Can I use open("/dev/if1"),open("/dev/if2") to read data from if1 and
> write data to if2?


If you have read permission for /dev/if1 and write permission for
/dev/if2 (and annotate the open() calls with the required flags)
and if the device driver for /dev/if1 allows reads and the one for
/dev/if2 supports write operations, then yes. Or, to be predantic,
no, because just opening the device files doesn't read or write
data, you of course also have to call e.g. the read(2) and write(2)
functions to do the reading and writing (but I guess doing so was
silently implied by your question;-).

Regards, Jens
--
\ Jens Thoms Toerring ___ Jens.Toerring@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com