Browse Source

Report actual disk size, not apparent size

tags/nilmdb-1.9.4
Jim Paris 10 years ago
parent
commit
6de77a08f1
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      nilmdb/utils/diskusage.py

+ 2
- 1
nilmdb/utils/diskusage.py View File

@@ -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)


Loading…
Cancel
Save