How to find out about free space on a given drive?

Dinu Gherman gherman at darwin.in-berlin.de
Tue Mar 20 13:15:55 CET 2001


Cameron Laird wrote:
> 
> When it matters enough to me, maybe I'll write up (partial)
> os.statvfs() implementations for Win*, or even MacOS, perhaps
> starting from <URL: http://mini.net/cgi-bin/wikit/526.html >
> (see "Disk free capacity") and submit the sources for inclu-
> sion in the distribution library.  It surprises me a teensy
> bit when I read, "I don't think you'll find a cross-platform
> solution", without the "yet" which belongs at the end.

I kicked-off a little debate on this y'day on python-dev, 
where, in the end, it didn't seem so impossible anymore:

  http://mail.python.org/pipermail/python-dev/2001-March/013706.html

I also found a good reference for Mac folks that might be 
helpful in implementing such a function in the os module: 

  http://developer.apple.com/techpubs/mac/Files/Files-96.html

Marc-Andre posted a sample Python implementation with some
white spots to fill in that can also be found in the thread
on python-dev.

Cameron or Jack (if he is listening): I'd be really happpy
to see that before Python 3000... but can't offer much more
then a few pints on the next conference. ;-)

Best regards,

Dinu

-- 
Dinu C. Gherman
ReportLab Consultant - http://www.reportlab.com
................................................................
"The only possible values [for quality] are 'excellent' and 'in-
sanely excellent', depending on whether lives are at stake or 
not. Otherwise you don't enjoy your work, you don't work well, 
and the project goes down the drain." 
                    (Kent Beck, "Extreme Programming Explained")



More information about the Python-list mailing list