4.2bsd eof flag in stdio

Ben Goldfarb goldfarb at ucf-cs.UUCP
Fri Nov 9 04:24:57 AEST 1984


[]

Why did Berkeley change stdio such that typing ^D (or whatever EOF character
one is using) on stdin causes that stream to reflect eof until a clearerr()
is done?  Has this been discussed here before?  If so, I apologize for 
further belaboring the issue.

In any case, what is the correct approach to this problem?  Obviously, we
can't expect the authors of programs that have been distributed with UNIX
since V7 to have provided for Berkeley's change; as it stands I've found
that addbib and learn are both broken because of the continual EOF.  So I
patched
		if (feof(stdin))
			clearerr(stdin);
into both programs.  I'm sure more are affected.  Alternatively, I could have
"fixed" stdio, but how many Berkeley programs make use of this "feature?"
I'd appreciate some net wisdom on the subject.  

-- 
Ben Goldfarb
University of Central Florida
uucp: {duke,decvax,princeton}!ucf-cs!goldfarb
ARPA: goldfarb.ucf-cs at csnet.relay
csnet: goldfarb at ucf



More information about the Comp.unix.wizards mailing list