fix checking the free diskspace on windows 7
This commit is contained in:
parent
f82c67f36c
commit
111b64d38b
|
@ -446,10 +446,9 @@ def free_space(path):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if windows_check():
|
if windows_check():
|
||||||
import win32api
|
import win32file
|
||||||
drive = path.split(":")[0]
|
sectors, bytes, free, total = map(long, win32file.GetDiskFreeSpace(path))
|
||||||
free = win32api.GetDiskFreeSpaceEx(drive)[0]
|
return (free * sectors * bytes)
|
||||||
return free
|
|
||||||
else:
|
else:
|
||||||
disk_data = os.statvfs(path)
|
disk_data = os.statvfs(path)
|
||||||
block_size = disk_data.f_bsize
|
block_size = disk_data.f_bsize
|
||||||
|
|
Loading…
Reference in New Issue