[Patches] [ python-Patches-410547 ] os.statvfs support for Windows

SourceForge.net noreply at sourceforge.net
Wed Jun 20 20:12:59 CEST 2007


Patches item #410547, was opened at 2001-03-22 17:58
Message generated for change (Comment added) made by carstenkoch
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=410547&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows
Group: None
Status: Closed
Resolution: Rejected
Priority: 3
Private: No
Submitted By: Fredrik Lundh (effbot)
Assigned to: Fredrik Lundh (effbot)
Summary: os.statvfs support for Windows

Initial Comment:
This patch adds (partial) os.statvfs support for
Windows.

The FRSIZE, BLOCKS, BFREE, BAVAIL, and NAMEMAX
fields are set.  Remaining fields are set to
zero, but should probably be set to None.

</F>

----------------------------------------------------------------------

Comment By: Carsten Koch (carstenkoch)
Date: 2007-06-20 20:12

Message:
Logged In: YES 
user_id=1823318
Originator: NO

Well, this has been rejected 6 years ago...
Is there a portable way to get the available disk space by now?

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-10 16:51

Message:
Logged In: YES 
user_id=6380

Rejecting, since nobody seems interested in moving on this.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-03-30 14:22

Message:
Logged In: YES 
user_id=6380

Thanks for the investigation, Tim!

Bouncing it back to Fredrik and lowered priority.

I certainly don't want to spend a lot of time on it; I
believe that the flamewar that started this was ill-advised
anyway. Finding out free space is hard; too bad.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-03-30 06:13

Message:
Logged In: YES 
user_id=31435

No, it did not go in.  I asked for a doc patch first so I 
wouldn't have to pee away time trying to guess what it 
does.  Now I've peed away the time, and I don't like it.  
Here's what it returns on my home desktop box (Win98SE, 
20Gb drive):

>>> os.statvfs("c:\\")  # argument is very touchy
(32768, 32768, 65526, 65526, 65526, 0, 0, 0, 0, 1024)
>>>

*Nothing* there makes sense, except for the last "max path" 
result.  Even the "block size" is wrong (the FAT32 fs on 
this box uses 16Kb clusters, not 32Kb).  Digging into the 
MS docs,

"""The GetDiskFreeSpace function returns incorrect values 
for volumes that are larger than 2 gigabytes"""

and

"""Even on volumes that are smaller than 2 gigabytes, the 
values stored into *lpSectorsPerCluster, 
*lpNumberOfFreeClusters, and *lpTotalNumberOfClusters 
values may be incorrect"""

under Win95, and, to judge from my desktop box, it appears 
useless under the latest flavor of Win98 too.

The function the patch uses is obsolete, and a ...Ex 
version is recommended in its place, which

"""returns correct values for all volumes, including those

that are greater than 2 gigabytes"""

BUT, *that* function isn't available under the original 
Win95, only under Win95 OSR2 and later.  In addition, that 
function only returns number of bytes total and free (as 64 
bit unsigned ints), nothing about block size, # clusters, 
etc.  (OTOH, total bytes is free is what people asked for!  
I don't recall anyone asking for a statvfs() clone)

So bouncing back to you:  how much time do you want me to 
devote to this?

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-03-29 19:28

Message:
Logged In: YES 
user_id=6380

Tim, wasn't this supposed to go into 2.1b2?  Did it?  Can it
go into 2.1final?


----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-03-22 22:35

Message:
Logged In: YES 
user_id=31435

/F, can you add a doc patch (for os.statvfs) that says 
enough so that a Windows user has some chance of guessing 
what this function returns?

BTW, I have no problem w/ returning zeroes instead of Nones.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=410547&group_id=5470


More information about the Patches mailing list