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

M.-A. Lemburg mal@lemburg.com
Mon, 19 Mar 2001 13:34:45 +0100


Dinu Gherman wrote:
> 
> Thomas Wouters wrote:
> >
> > 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 :)
> 
> Well, this is the usual "If you need it, do it yourself!"
> answer, that bites the one who dares to speak up for all
> those hundreds who don't... isn't it?
> 
> Rather than asking one non-expert in N-1 +/- 1 operating
> systems to implement it, why not ask N experts in imple-
> menting Python on 1 platform to do the job? (Notice the
> potential for parallelism?! :)

I think the problem with this one really is the differences
in OS designs, e.g. on Windows you have the concept of drive
letters where on Unix you have mounted file systems. Then there
also is the concept of disk space quota per user which would
have to be considered too.

Also, calculating the available disk space may return false
results (e.g. for Samba shares).

Perhaps what we really need is some kind of probing function
which tests whether a certain amount of disk space would be
available ?!

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Pages:                           http://www.lemburg.com/python/