How to check amt of SPACE FREE on HDD

Gillou nospam at bigfoot.com
Fri Dec 20 17:25:59 EST 2002


"RichardJ" <richardj at syspres.com> a écrit dans le message de news:
jrIM9.286872$GR5.95456 at rwcrnsc51.ops.asp.att.net...
> New to python, but have all the O'Reilly Python books and was not able to
> find the call you would use to check the amount of space is available on a
> hard-drive.
>
> The application will be downloading huge amount of data using ftp, so
needs
> to check how much space is available. At the moment running on WinXP Pro,
> but likely to run on Linux.
>
> Very much appreciate any help.
> Thanks,
> Richard
>
>
My solution runs on Windows only...

If you got win32all package, search for GetDiskFreeSpace in the help

http://starship.python.net/crew/skippy/win32/Downloads.html

On a Unix machine you can spawn the "df" command and parse the result.
$ man df

But there are perhaps better solutions.

--Gilles






More information about the Python-list mailing list