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

Thomas Wouters thomas@xs4all.net
Mon, 19 Mar 2001 13:07:13 +0100


On Mon, Mar 19, 2001 at 12:57:49PM +0100, Dinu Gherman wrote:
> I wrote on comp.lang.python today:
> > is there a simple way (or any way at all) to find out for 
> > any given hard disk how much free space is left on that
> > device? I looked into the os module, but either not hard
> > enough or there is no such function. Of course, the ideal
> > solution would be platform-independant, too... :)

> Is there any good reason for not having a cross-platform
> solution to this? I'm certainly not the first to ask for
> such a function and it certainly exists for all platforms,
> doesn't it?

I think the main reason such a function does not exist is that no-one wrote
it. If you can write a portable function, or fake one by making different
implementations on different platforms, please contribute ;) Step one is
making an inventory of the available functions, though, so you know how
large an intersection you have to work with. The fact that you have to start
that study is probably the #1 reason no-one's done it yet :)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!