Re: free disk space

From: Peter Pichler (pichlo6_at_pobox.sk)
Date: 10/29/03


Date: Tue, 28 Oct 2003 23:56:39 -0000


"Mark Gordon" <spamtrap@flash-gordon.me.uk> wrote:
> "Nils Petter Vaskinn" <no@spam.for.me.invalid> wrote:
> > > Piotr <torwalds@wp.pl> scribbled the following:
> > >> What is the simple function checking free disk space ?
> > >> thank you
> >
> > 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 :)
>
> What you suggested IS a platform specific way. If you try it on a file
> system with file versioning when you reopen the file it might just
> create a new version of the file leaving the old on on the disk. If you
> use a temporary file instead, it might be held in memory and therefor
> report free space even if the disk is full.

Not to mention file systems with limited file sizes, where the available
disk space may be significantly greater than a file you would create
using that method. At least the "at least" would apply in such a case :)

Peter



Relevant Pages

  • Re: FAT32 or NTFS?
    ... >>10% wastage on 10 volumes is one whole hard disk wasted. ... >uncertainty about free space. ... Corrupt data can be better than none, ... "you can only recover part of the database". ...
    (microsoft.public.windowsxp.general)
  • Re: defragmentation issues in XP
    ... The problem could be the fragmented pagefile. ... This is probably scattered across the drive causing the free space to be equally fragmented. ... You need to maximise the free disk space before running disk defragmenter again. ... You do not want Windows to manage the pagefile as using that setting causes the pagefile file to fragment. ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: defrag hard drive
    ... with a lower percentage free space that is a mixed blessing. ... The Disk Defragmenter provided with Windows is perfectly adequate. ... If not compressed you can compress them. ... If you need to defrag, get the free space down to atleast 15%. ...
    (microsoft.public.windowsxp.general)
  • Re: Page File Defragmentation
    ... Fat 16 under Dos/Win9x is start writing at beginning of disk using whatever free space you find. ... > My initial reaction was to take your words "Again your restore points are ... >>>System restore folders seem to break into large numbers of fragments! ...
    (microsoft.public.windowsxp.general)
  • Re: Page File Defragmentation
    ... tell how large bits of free space are and 500 kb is quite small in global ... fragments would seem more likely if available space was the only governing ... Fat 16 under Dos/Win9x is start writing at beginning of disk using whatever ... > My initial reaction was to take your words "Again your restore points are ...
    (microsoft.public.windowsxp.general)