Path: utzoo!mnetor!uunet!husc6!hao!oddjob!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: closing stdout Message-ID: <9754@mimsy.UUCP> Date: 13 Dec 87 22:02:28 GMT References: <442@cresswell.quintus.UUCP> <9658@mimsy.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 17 Summary: small correction In article <9658@mimsy.UUCP> I claimed: >In fact, 4.3BSD stdio will allow this: > > FILE *fp = fopen("foo", "r"); [write, successfully, to file fp] > if (fflush(fp) || ferror(fp) || fclose(fp)) > fprintf(stderr, "something went wrong\n"); > >Everything works ... iff file foo did not exist before the fopen! Oops, this was exactly backwards: everything works iff file foo *did* exist before the fopen. Thanks to michael@stb.UUCP for noticing this one. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris