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

Fredrik Lundh fredrik@effbot.org
Tue, 20 Mar 2001 09:58:53 +0100


Tim Peters wrote:
> One of the best things Python ever did was to introduce os.path.getsize() +
> friends, saving the bulk of the world from needing to wrestle with the
> obscure Unix stat() API.

yup (I remember lobbying for those years ago), but that doesn't
mean that we cannot make already existing low-level APIs work
on as many platforms as possible...

(just like os.popen etc)

adding os.statvfs for windows is pretty much a bug fix (for 2.1?),
but adding a new API is not (2.2).

> os.chmod() is another x-platform teachability pain

shutil.chmod("file", "g+x"), anyone?

> if there's anything worth knowing in the bowels of statvfs(), let's
> please spell it in a human-friendly way from the start.

how about os.path.getfreespace("path") and
os.path.gettotalspace("path") ?

Cheers /F