Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.lang.c Subject: Re: stdio error detection Message-ID: <9022@utzoo.UUCP> Date: Wed, 2-Dec-87 14:07:00 EST Article-I.D.: utzoo.9022 Posted: Wed Dec 2 14:07:00 1987 Date-Received: Wed, 2-Dec-87 14:07:00 EST References: <289@cresswell.quintus.UUCP> Organization: U of Toronto Zoology Lines: 11 Keywords: errno fclose fopen stdio errors > One thing I am worried about is fclose(). > - Under what conditions (other than not-open file or invalid address &c) > can this return an error result? As others have mentioned, the buffer flush that often accompanies fclose() can produce an I/O error. Not common. However, checking for it is *vital* on systems with disk quotas, because that flush may blow the quota and fail. If you don't check the fclose() result, you get a silently truncated file. -- Those who do not understand Unix are | Henry Spencer @ U of Toronto Zoology condemned to reinvent it, poorly. | {allegra,ihnp4,decvax,utai}!utzoo!henry