Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site mcvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!floyd!cmcl2!philabs!mcvax!guido From: guido@mcvax.UUCP (Guido van Rossum) Newsgroups: net.unix-wizards Subject: Re: getc() != EOF Message-ID: <5827@mcvax.UUCP> Date: Fri, 1-Jun-84 00:06:50 EDT Article-I.D.: mcvax.5827 Posted: Fri Jun 1 00:06:50 1984 Date-Received: Tue, 5-Jun-84 08:39:05 EDT References: <30@utastro.UUCP> <402@turtlevax.UUCP> Organization: "Stamp Out BASIC" Committee, CWI, Amsterdam Lines: 14 > while (!feof(stdin)) putchar(getchar()); > >does not work. It seems that the EOF indicator does not come on until >the EOF marker has been read. Previous versions of the standard I/O >library set the EOF flag if the last character has been read and the >next one will be and EOF. How *could* this ever have worked under UNIX??? Remember that the input can be a pipe. You only know there's no more data when a READ system call returns <= 0. -- Guido van Rossum, "Stamp Out BASIC" Committee, CWI, Amsterdam guido @ mcvax