diff options
author | Andrew Resch <andrewresch@gmail.com> | 2009-04-25 07:24:58 +0000 |
---|---|---|
committer | Andrew Resch <andrewresch@gmail.com> | 2009-04-25 07:24:58 +0000 |
commit | 127b58c36d9228200d880dc2f80abe1cb7cc456a (patch) | |
tree | c30658f340b4a11666775519990bb00000300a09 | |
parent | 587d9a7e5f390f7d79f473bc6adc9336055a2add (diff) | |
download | deluge-127b58c36d9228200d880dc2f80abe1cb7cc456a.tar.gz deluge-127b58c36d9228200d880dc2f80abe1cb7cc456a.tar.bz2 deluge-127b58c36d9228200d880dc2f80abe1cb7cc456a.zip |
Fix free space check in Windows
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | deluge/common.py | 7 |
2 files changed, 4 insertions, 4 deletions
@@ -13,6 +13,7 @@ ==== Windows ==== * Fix freezing in create torrent dialog * Fix creating torrents in Windows + * Fix free space check === Deluge 1.1.6 - (06 April 2009) === ==== Core ==== diff --git a/deluge/common.py b/deluge/common.py index 7030aaa6e..215a030e1 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -452,10 +452,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 |