From c46a17f07b5e5d84b371255878f41c36a6359eba Mon Sep 17 00:00:00 2001 From: Daniel Loffgren <ryukojiro@gmail.com> Date: Fri, 10 Oct 2014 18:55:40 -0700 Subject: 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 --- pyload/utils/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pyload/utils/__init__.py') 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 -- cgit v1.2.3