mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 08:28:39 +00:00
Fix #2240 : Win32 freespace issue with large capacity drives
This commit is contained in:
parent
3d1b47bca6
commit
669d10e6be
1 changed files with 2 additions and 3 deletions
|
@ -529,9 +529,8 @@ def free_space(path):
|
||||||
raise InvalidPathError("%s is not a valid path" % path)
|
raise InvalidPathError("%s is not a valid path" % path)
|
||||||
|
|
||||||
if windows_check():
|
if windows_check():
|
||||||
import win32file
|
from win32file import GetDiskFreeSpaceEx
|
||||||
sectors, bytes, free, total = map(long, win32file.GetDiskFreeSpace(path))
|
return GetDiskFreeSpaceEx(path)[0]
|
||||||
return (free * sectors * bytes)
|
|
||||||
else:
|
else:
|
||||||
disk_data = os.statvfs(path.encode("utf8"))
|
disk_data = os.statvfs(path.encode("utf8"))
|
||||||
block_size = disk_data.f_frsize
|
block_size = disk_data.f_frsize
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue