Re: free disk space
From: Peter Pichler (pichlo6_at_pobox.sk)
Date: 10/29/03
- Next message: murmsk: "c#"
- Previous message: Peter Nilsson: "Re: Operator question"
- In reply to: Mark Gordon: "Re: free disk space"
- Next in thread: Kelsey Bjarnason: "Re: free disk space"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: murmsk: "c#"
- Previous message: Peter Nilsson: "Re: Operator question"
- In reply to: Mark Gordon: "Re: free disk space"
- Next in thread: Kelsey Bjarnason: "Re: free disk space"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|