[Python-Dev] Function in os module for available disk space, why not?

Guido van Rossum guido@digicool.com
Mon, 19 Mar 2001 09:58:29 -0500


> I'm just trying to make the point that from a user perspective 
> it would be more complete to have such a function in the os 
> module (where it belongs), that would also work on Macs e.g., 
> as well as more conveniant, because even when that existed in 
> modules like win32api (where it does) and in one of the (many) 
> mac* ones (which I don't know yet if it does) it would save 
> you the if-statement on sys.platform.

Yeah, yeah, yeah.  Whine, whine, whine.  As has been made abundantly
clear, doing this cross-platform requires a lot of detailed platform
knowledge.  We at PythonLabs don't have all the wisdom, and we often
rely on outsiders to help us out.  Until now, finding out how much
free space there is on a disk hasn't been requested much (in fact I
don't recall seeing a request for it before).  That's why it isn't
already there -- that plus the fact that traditionally on Unix this
isn't easy to find out (statvfs didn't exist when I wrote most of the
posix module).  I'm not against adding it, but I'm not particularly
motivated to add it myself because I have too much to do already (and
the same's true for all of us here at PythonLabs).

> It sounds silly to me if people now pushed into learning Py-
> thon as a first programming language had to use such state-
> ments to get along, but were given the 'gift' of 1/2 = 0.5
> which we seem to spend an increasing amount of brain cycles
> on...

I would hope that you agree with me though that the behavior of
numbers is a lot more fundamental to education than finding out
available disk space.  The latter is just a system call of use to a
small number of professionals.  The former has usability implications
for all Python users.

--Guido van Rossum (home page: http://www.python.org/~guido/)