Code: Select all
>>> import win32api
>>> win32api.GetDiskFreeSpace('z:/')
(2, 512, -951626036, -1)
Code: Select all
>>> win32api.GetDiskFreeSpaceEx('z:/')
(3423581450240L, 4464200622080L, 3423581450240L)
Code: Select all
--- sabnzbd\interface.py.orig 2009-02-05 13:39:48.656250000 +0000
+++ sabnzbd\interface.py 2009-02-05 14:46:52.265625000 +0000
@@ -89,14 +89,14 @@
# windows diskfree
def diskfree(_dir):
try:
- secp, byteper, freecl, noclu = win32api.GetDiskFreeSpace(_dir)
- return (secp * byteper * freecl) / GIGI
+ available, disk_size, total_free = win32api.GetDiskFreeSpaceEx(_dir)
+ return available / GIGI
except:
return 0.0
def disktotal(_dir):
try:
- secp, byteper, freecl, noclu = win32api.GetDiskFreeSpace(_dir)
- return (secp * byteper * noclu) / GIGI
+ available, disk_size, total_free = win32api.GetDiskFreeSpaceEx(_dir)
+ return disk_size / GIGI
except:
return 0.0