diff options
author | Damien Churchill <damoc@gmail.com> | 2009-04-20 21:05:05 +0000 |
---|---|---|
committer | Damien Churchill <damoc@gmail.com> | 2009-04-20 21:05:05 +0000 |
commit | 111b64d38be3ba2d71f190267f847f7a83822296 (patch) | |
tree | 6439c35f676a10b035bbd5dad57c243a75da2f97 | |
parent | f82c67f36cfa69c44f8a851dafceadba0909c49d (diff) | |
download | deluge-111b64d38be3ba2d71f190267f847f7a83822296.tar.gz deluge-111b64d38be3ba2d71f190267f847f7a83822296.tar.bz2 deluge-111b64d38be3ba2d71f190267f847f7a83822296.zip |
fix checking the free diskspace on windows 7
-rw-r--r-- | deluge/common.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/deluge/common.py b/deluge/common.py index 76344cb09..6f93dac65 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -446,10 +446,9 @@ def free_space(path): """ if windows_check(): - import win32api - drive = path.split(":")[0] - free = win32api.GetDiskFreeSpaceEx(drive)[0] - return free + import win32file + sectors, bytes, free, total = map(long, win32file.GetDiskFreeSpace(path)) + return (free * sectors * bytes) else: disk_data = os.statvfs(path) block_size = disk_data.f_bsize |