LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   sample example of how to read files (https://www.linuxquestions.org/questions/programming-9/sample-example-of-how-to-read-files-557379/)

amit_pansuria 05-29-2007 03:33 AM

sample example of how to read files
 
can any one give me sample program which reads files from serial port(Rs-232) and write it into another serial port. i m using fedora core -6
Best Regards,
Amit

tread 05-29-2007 04:29 AM

See minicom source code.

theNbomr 05-29-2007 10:30 AM

You can keep asking the same question, hoping to get an answer that satisfies you, but the correct answers have already been supplied. Serial ports do not embrace any concept of files. They are merely conveyors of bits and bytes. To understand the mechanics of passing streams of bytes through a serial interface, see the two HOWTO's regarding serial IO programming on tldp.org: http://tldp.org/HOWTO/Serial-HOWTO.html, and http://tldp.org/HOWTO/Serial-Program...WTO/index.html There are several examples in the HOWTO's. It will be up to you to contrive a method of transferring the file-related data, plus any error checking, however this is simply a re-invention of a solution that has been done many times already. You could implement an already existing protocol, and the suggestions of Zmodem and Kermit protocols have been made. There are others, if you do just a little bit of research.
--- rod.


All times are GMT -5. The time now is 04:25 AM.