[ECOS] FILESYSTEM QUESTION: reading all of the data in a file.

Andrew Lunn andrew@lunn.ch
Tue Nov 9 20:45:00 GMT 2004


On Wed, Nov 10, 2004 at 08:57:18AM +1300, Dave Rentoul wrote:
> the POSIX read command: extern ssize_t     read(int fd, void *buf, 
> size_t nbyte);
> 
> I wish to read all the bytes in a jffs2 file, then use the size returned 
> in a "cyg_io_write()" command to a serial interface modem, to send this 
> data to the TX_FIFO.
> 
> Is there a method of reading all the bytes in a file without keeping a 
> separately record of the number of bytes written to the file? or, is 
> there a function that returns the number of bytes of data in a file? if 
> so, what is the POSIX command?

stat()

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list