Aucbvax.2400
fa.unix-wizards
utzoo!decvax!ucbvax!dcrocker@udel
Wed Jul 22 06:39:14 1981
 Re:  fread and read from a terminal
From:      Dave Crocker <DCROCKER@UDEL>
You miss the point.

1.  Stdio's _filbuf() thinks that end-of-file has been reached,
because it sets the bit.  (I.e., feof(stdin) returns true.)

2.  I said that the control-D was typed at the beginning of the
line, thus forcing a zero-length read().

The problem is that fread() is not correctly dealing with the fact
that its input is buffered and, hence, it must defer reporting some
events, such as end-of-file.

Dave



-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <[email protected]>
of http://communication.ucsd.edu/A-News/


This Usenet Oldnews Archive
article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.