sticky EOF

Mike Haertel mike at thor.acc.stolaf.edu
Sun May 7 11:07:19 AEST 1989


After EOF is returned for the first time, Berkeley stdio functions
will not attempt to read further input if the user tries, but will
instead continue returning EOF.

In Ritchie stdio (v7, System V) subsequent calls to stdio functions
will attempt further reads, and return EOF only if the further reads
also return EOF.

I'm curious which behavior people prefer.  The Berkeley behavior
is more convenient for a certain class of lazy programmer, and the
Ritchie behavior is more similar to the underlying Unix calls.

The May 13 1988 dpANS merely says "If the stream is at end-of-file,
the end-of-file indicator for the stream is set and fgetc returns
EOF."  It doesn't appear to say anything about the behavior of
subsequent calls.
-- 
Mike Haertel <mike at stolaf.edu>
main() ??< printf("hello, world??/n"); ??>



More information about the Comp.unix.wizards mailing list