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

Dinu Gherman gherman@darwin.in-berlin.de
Mon, 19 Mar 2001 16:32:51 +0100


Gordon McMillan wrote:
> 
> Considering that:
>  - it's not uncommon to map things into the filesystem's
>    namespace for which "free space" is meaningless

Unless I'm totally stupid, I see the concept of "free space" as
being tied to the *device*, not to anything being mapped to it 
or not.

>  - for network mapped storage space it's quite likely you can't
>    get a meaningful number

Fine, then let's play the exception blues...

>  - for compressed file systems the number will be inaccurate

Then why is the OS function call there...? And: nobody can *seri-
ously* expect an accurate figure of the remaining space for com-
pressed file systems, anyway, and I think nobody does! But there
will always be some number >= 0 of uncompressed available bytes 
left.

>  - even if you get an accurate answer, the space may not be
>    there when you go to use it (so need try... except anyway)

The same holds for open(path, 'w') - and still this function is 
considered useful, isn't it?!

> I find it perfectly sensible that Python does not dignify this
> mess with an official function.

Well, I have yet to see a good argument against this...

Regards,

Dinu