Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watmath.UUCP Path: utzoo!watmath!idallen From: idallen@watmath.UUCP Newsgroups: net.unix-wizards Subject: MAN pages say you can't (?) FCLOSE any input files. Message-ID: <728@watmath.UUCP> Date: Wed, 8-Jan-86 17:23:27 EST Article-I.D.: watmath.728 Posted: Wed Jan 8 17:23:27 1986 Date-Received: Wed, 8-Jan-86 23:33:06 EST Distribution: net Organization: U of Waterloo, Ontario Lines: 25 Our 4.1/4.2bsd and Ultrix documentation says that FCLOSE or FFLUSH on a non-output file must return EOF. Now, it doesn't say that an EOF indicates an error, but I assume that is what is meant. In reality (4.1/4.2/Ultrix), FCLOSE on an input file returns zero because FFLUSH of an input file returns zero and that is the value FCLOSE returns. We've modified FFLUSH to return EOF (indicating an error) when applied to a non-output file, but that means FCLOSE is also returning that EOF when applied to an input file, which we find hard to stomach. We want to amend the documentation to state that FCLOSE may be applied to an open input file, and it will return zero in this case. Any reason not to do this? Simple votes or comments not of world-wide interest should be mailed to me, not posted to the whole net, please. Note: For those who, like I, thought FFLUSH should be applicable to a buffered input stream, consider the portability problems associated with making sure that not only have you flushed all the input buffered in your library, but also the input held by the operating system. In reality, 4.2bsd FFLUSH does absolutely nothing when passed an input file descriptor, and it returns zero. Ours now returns EOF. -- -IAN! (Ian! D. Allen) University of Waterloo