🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #569

Disk Full

#569
From: Ted H. Emigh
Date: Sat, 02 Jun 1990 00:44
20 lines
1585 bytes
Several people suggested ferror() as a way of checking for disk full.
Basically, this is the solution.  However, there are some things of which
to be careful.
1)	ferror() returns an error condition only when the buffer is flushed
	to disk.  For my floppy drives this is every 512 bytes.  An ferror()
	condition thus can refer to several fprintf's (or f...).  I presume
	this is universal behaviour for buffered prints.

2)	If the disk becomes full on the last buffer, then ferror() will not
	return an error condition on the f....  Instead, you should issue an
	fflush(fout).  If the disk is full (or other error), then this will
	return a nonzero number.  An ferror() after this will return the disk
	full message (0x10).  This can also be done with fclose(fout), but
	since fout is located on the heap, and fclose() frees the space, this
	is a riskier business.

-- 
Ted H. Emigh, Dept. Genetics and Statistics, NCSU, Raleigh, NC
uucp:	mcnc!ncsuvx!ncsugn!emigh	internet:  emigh@ncsugn.ncsu.edu
BITNET: emigh%ncsugn@MCNC.UUCP  or  emigh%ncsugn@ncsuvx.ncsu.edu
Technical Details
Message-ID: <5721@ncsugn.ncsu.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!aplcen!unmvax!sci.ccny.cuny.edu!cucard!dasys1!cooper!phri!sci.ccny.cuny.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!xanth!mcnc!ncsuvx!ncsugn!emigh

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!aplcen!unmvax!sci.ccny.cuny.edu!cucard!dasys1!cooper!phri!sci.ccny.cuny.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!xanth!mcnc!ncsuvx!ncsugn!emigh
From: emigh@ncsugn.ncsu.edu (Ted H. Emigh)
Newsgroups: comp.sys.ibm.pc.programmer,alt.msdos.programmer
Subject: Disk Full
Message-ID: <5721@ncsugn.ncsu.edu>
Date: 2 Jun 90 00:44:34 GMT
Reply-To: emigh@ncsugn.UUCP (Ted H. Emigh)
Organization: Genetics, North Carolina State University, Raleigh, NC
Lines: 20