🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#567
From: Stephen M. Dunn
Date: Fri, 01 Jun 1990 22:53
18 lines
1770 bytes
In article <22661.2612e98b@kuhub.cc.ukans.edu> 2fjomummer@kuhub.cc.ukans.edu writes:
$Although I've never actually tried it, there is an MS-DOS function that reports
$the free space on a drive.  I'm basically a Turbo Pascal programmer, so I don't

   Yes, this will work to a certain extent, but the granularity involved is
the cluster size.  On a hard disk with 8 sectors per cluster, for example,
this call will return 0 bytes free for any amount less than 4096 bytes.  If
I have 4K left on the disk and I want to write a 3K file, 1K at a time,
the first write will work, but after that it will report 0 free space, even
though I still have 3K left and only need 2K of it.

   There's no need to go into details of the ferror () solution, as many
people have posted it already.
-- 
               More half-baked ideas from the oven of:
****************************************************************************
Stephen M. Dunn                               cs4g6ag@maccs.dcss.mcmaster.ca
     <std_disclaimer.h> = "\nI'm only an undergraduate ... for now!\n";
Technical Details
Message-ID: <2613FB85.22406@maccs.dcss.mcmaster.ca>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!shelby!rutgers!uwm.edu!rpi!sci.ccny.cuny.edu!cucard!dasys1!cooper!phri!sci.ccny.cuny.edu!unmvax!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!geac!maccs!cs4g6ag
References: <5705@ncsugn.ncsu.edu> <22661.2612e98b@kuhub.cc.ukans.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!shelby!rutgers!uwm.edu!rpi!sci.ccny.cuny.edu!cucard!dasys1!cooper!phri!sci.ccny.cuny.edu!unmvax!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!geac!maccs!cs4g6ag
From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn)
Newsgroups: comp.sys.ibm.pc.programmer,alt.msdos.programmer
Subject: Re: Problem with disk full in programs compiled with Turbo-C
Message-ID: <2613FB85.22406@maccs.dcss.mcmaster.ca>
Date: 1 Jun 90 22:53:08 GMT
References: <5705@ncsugn.ncsu.edu> <22661.2612e98b@kuhub.cc.ukans.edu>
Organization: McMaster University, Hamilton, Ontario
Lines: 18