🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Problem with disk full in programs compiled with Turbo-C

#206
From: Ralf.Brown
Date: Tue, 27 Mar 1990 13:49
28 lines
1676 bytes
In article <5705@ncsugn.ncsu.edu>, emigh@ncsugn.ncsu.edu (Ted H. Emigh) wrote:
}I am using Turbo-C (Version 2.0), and am having trouble determining if the
}disk is full.  I have tried the obvious (at least to me obvious):
}1)      Code fragment:
}        result=fprintf(...)
}        if(result==EOF) { do something}
}
}        result always returns the number of characters -- even if the disk
}        is full.  There is disk activity, but nothing is written (obviously).
}
}2)      Code fragment:
}        harderr(hardware_handler);
}
}        This routine is never called for disk full.  It functions OK for write-
}        protect and disk not ready, but not for disk full.

Try
       fprintf(file,...) ;
       if (ferror(file))
	  { do something }

--
UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=- 412-268-3053 (school) -=- FAX: ask
ARPA: ralf@cs.cmu.edu  BIT: ralf%cs.cmu.edu@CMUCCVMA  FIDO: Ralf Brown 1:129/46
"How to Prove It" by Dana Angluin              Disclaimer? I claimed something?
16. proof by cosmology:
    The negation of the proposition is unimaginable or meaningless.  Popular
    for proofs of the existence of God.
Technical Details
Message-ID: <260f7d78@ralf>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!Ralf.Brown@B.GP.CS.CMU.EDU

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!Ralf.Brown@B.GP.CS.CMU.EDU
From: Ralf.Brown@B.GP.CS.CMU.EDU
Newsgroups: comp.sys.ibm.pc.programmer,alt.msdos.programmer
Subject: Re: Problem with disk full in programs compiled with Turbo-C
Message-ID: <260f7d78@ralf>
Date: 27 Mar 90 13:49:28 GMT
Sender: ralf@b.gp.cs.cmu.edu
Organization: Carnegie Mellon University School of Computer Science
Lines: 28
In-Reply-To: <5705@ncsugn.ncsu.edu>