4.2bsd eof flag in stdio

Guy Harris guy at rlgvax.UUCP
Fri Nov 30 17:21:39 AEST 1984


> It is the nature of UNIX terminals that you can read past the EOF;

It isn't just the nature of UNIX terminals.  Some DEC OSes use the same
behavior; EDT terminates input mode with a ^Z, their EOF character.
Actually, quoting the VMS manuals, "CTRL/Z - Echoes ^Z when CTRL/Z is
typed as a *read terminator*.  *By convention*, CTRL/Z constitutes
end-of-file."  This implies (although it may not be the case) that ^Z
works in VMS exactly like ^D does in UNIX.  This is worth pointing out,
since it was stated in an earlier article that there are more OSes with
"hard" rather than "soft" EOFs.  I hope their EOFs aren't too hard; most
systems I've seen will let you type in a bunch of text as input to a program
and type your favorite EOF character and end input to that program without
ending input to all programs that run from that terminal during that session.
(Admittedly, most systems I've seen are either UNIX or DEC OSes.)

By the way, I saw a later version of "stdio" for 4.2 that looked like
it had the change rescinded; was this the case?  (In which case, a lot of
this discussion is somewhat moot.)

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.unix.wizards mailing list