From 6de77a08f1f47526af97d19337949cb59932396e Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Mon, 5 Aug 2013 12:16:56 -0400 Subject: [PATCH] Report actual disk size, not apparent size --- nilmdb/utils/diskusage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nilmdb/utils/diskusage.py b/nilmdb/utils/diskusage.py index 0eea832..a7a2c32 100644 --- a/nilmdb/utils/diskusage.py +++ b/nilmdb/utils/diskusage.py @@ -21,7 +21,8 @@ def du(path): errors that might occur if we encounter broken symlinks or files in the process of being removed.""" try: - size = os.path.getsize(path) + st = os.stat(path) + size = st.st_blocks * st.st_blksize if os.path.isdir(path): for thisfile in os.listdir(path): filepath = os.path.join(path, thisfile)