Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: news.admin Subject: Re: Empty News Articles Message-ID: <499@auspex.UUCP> Date: 23 Nov 88 19:18:33 GMT References: <341@igor.Rational.COM> <53200002@uicsrd.csrd.uiuc.edu> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 18 >I know that "write" often returns immediately (using write-behind), so >there's no guarantee of an error code being returned. Isn't there >some other way for news/notes to check for a full filesystem? "write" to a UNIX file system should allocate space immediately, even if it defers the actual "write". It does so on both V7/S5 or 4.2BSD file system under all the UNIX systems I know of. "write" to an file system mounted over NFS will do the allocation on the server, so allocation will be deferred, and you may not get notification of a full file system. In this case, if you system supports "fsync", you should do an "fsync" before you close the file descriptor (if you're using standard I/O, do an "fflush" to flush standard I/O's buffers, and then do an "fsync(fileno(xxx))", before you do the "fclose") and check the error return from the "fsync". The SunOS NFS implementation (from which many, perhaps most, UNIX ones are derived) will "remember" errors such as "file system full", and will report them to you if you do an "fsync".