Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!siebren From: siebren@cwi.nl (Siebren van der Zee) Newsgroups: comp.std.c Subject: Testing I/O success (Was: Portable Self-Replicating C Contest) Summary: I/O on unix Message-ID: <8019@boring.cwi.nl> Date: 10 Apr 89 11:21:26 GMT References: <12144@haddock.ima.isc.com> <12593@haddock.ima.isc.com> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 13 In article <12593@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >Note rule 3. Output calls can fail (e.g. disk full); the program must detect >this condition and return the value EXIT_FAILURE to the execution environment. >This constant is defined in , which must therefore be included. You *CANNOT* detect disk-full always on unix, since I/O is lazy. The last block of a file may be written to disk after the program has exited. As far as the contest (and _ANY_ serious program) is concerned, you still have to check whatever you can, of course. >Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint Siebren van der Zee, siebren@cwi.nl