diff options
author | Daniel Loffgren <ryukojiro@gmail.com> | 2014-10-11 03:55:40 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-11 13:23:49 +0200 |
commit | c46a17f07b5e5d84b371255878f41c36a6359eba (patch) | |
tree | 306d8bec1426741b4b12a2de1fe4a7fc73fa8976 /pyload/utils/__init__.py | |
parent | Fix previous merging (diff) | |
download | pyload-c46a17f07b5e5d84b371255878f41c36a6359eba.tar.xz |
Use fundamental block size to calculate free byte count. Preferred blocks are not guaranteed to line up with real blocks.
Conflicts:
pyload/utils/__init__.py
Diffstat (limited to 'pyload/utils/__init__.py')
-rw-r--r-- | pyload/utils/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pyload/utils/__init__.py b/pyload/utils/__init__.py index 1c586912e..06582708b 100644 --- a/pyload/utils/__init__.py +++ b/pyload/utils/__init__.py @@ -143,7 +143,7 @@ def freeSpace(folder): return free_bytes.value else: s = os.statvfs(folder) - return s.f_bsize * s.f_bavail + return s.f_frsize * s.f_bavail def fs_bsize(path): @@ -158,7 +158,7 @@ def fs_bsize(path): ctypes.windll.kernel32.GetDiskFreeSpaceW(ctypes.c_wchar_p(drive), ctypes.pointer(cluster_sectors), ctypes.pointer(sector_size), None, None) return cluster_sectors * sector_size else: - return os.statvfs(path).f_bsize + return os.statvfs(path).f_frsize def uniqify(seq): #: Originally by Dave Kirby |