Re: free disk space

From: Kelsey Bjarnason (kelseyb_at_xxnospamyy.lightspeed.bc.ca)
Date: 10/25/03


Date: Fri, 24 Oct 2003 22:32:22 -0700

On Tue, 21 Oct 2003 12:50:11 +0000, Nils Petter Vaskinn wrote:

> On Tue, 21 Oct 2003 12:40:29 +0000, Joona I Palaste wrote:
>
>> Piotr <torwalds@wp.pl> scribbled the following:
>>> What is the simple function checking free disk space ?
>>> thank you
>>
>> There isn't one in standard C.
>
> open a file,
> write to the file until you get an error, counting bytes
> close and reopen the file to free the space
> close the file
>
> Now the filesystem should have atleast as much free space as the bytes you
> counted.
>
> But he'd probably be better of using a platform specific way :)

I can just picture doing this on a system with a large storage array...
say one of those nifty 43TB units. A week or two later and he finally has
his value... :)



Relevant Pages

  • Re: SO I CALLED USAU HDQTS ABOUT THE COSTS OF THE CBS PRESENTATIONS AND.....
    ... Also counting all the travel and whatnot, ... that seems like a pretty standard MR budget. ...
    (rec.sport.disc)
  • Re: too strict on min disk free alarm? (5%/300GB drive)
    ... standard is as far as "free space" is concerned and how it affects the ... performance at different intervals of % of free space. ... mind is to prevent a system crash by running out of disk space. ... after issuing a command to recursively change the permissions of a dir ...
    (microsoft.public.windows.server.general)
  • Re: free disk space
    ... >> There isn't one in standard C. ... What you suggested IS a platform specific way. ... create a new version of the file leaving the old on on the disk. ... report free space even if the disk is full. ...
    (comp.lang.c)
  • Re: [2.6 patch] Define BITS_PER_BYTE
    ... In newsgroup: linux.dev.kernel ... > counting bits. ... Tough cookies. ... The standard name for this define is CHAR_BIT, ...
    (Linux-Kernel)
  • Re: free disk space
    ... >> write to the file until you get an error, counting bytes ... > create a new version of the file leaving the old on on the disk. ... > report free space even if the disk is full. ... Not to mention file systems with limited file sizes, ...
    (comp.lang.c)