[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read-file

From: Larry Jones
Subject: Re: read-file
Date: Fri, 16 Jun 2006 16:01:18 -0400 (EDT)

Simon Josefsson writes:
> OTOH, if the EOF marker is already set, should we really continue to
> read from the stream?  The function may take an already open stream,
> that have been read from before.
> Perhaps the function should also test ferror outside of the loop...

If either the end-of-file or error indicators are set for the stream,
the C Standard requires fread to immediately return 0 (aka "sticky"
EOF).  Most traditional implementations, however, do not do that.  That
said, I really don't care one way or the other what you do about it.  :-)

-Larry Jones

I think if Santa is going to judge my behavior over the last year,
I ought to be entitled to legal representation. -- Calvin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]