mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
Fix free space check in Windows
This commit is contained in:
parent
587d9a7e5f
commit
127b58c36d
2 changed files with 4 additions and 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 ====
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue