This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: FILESYSTEM QUESTION: reading all of the data in a file.
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Dave Rentoul <drentoul at elands dot co dot nz>
- Cc: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Tue, 9 Nov 2004 21:38:09 +0100
- Subject: Re: [ECOS] FILESYSTEM QUESTION: reading all of the data in a file.
- References: <4191211E.3090300@elands.co.nz>
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