Report actual disk size, not apparent size
This commit is contained in:
parent
8db9771c20
commit
6de77a08f1
|
@ -21,7 +21,8 @@ def du(path):
|
||||||
errors that might occur if we encounter broken symlinks or
|
errors that might occur if we encounter broken symlinks or
|
||||||
files in the process of being removed."""
|
files in the process of being removed."""
|
||||||
try:
|
try:
|
||||||
size = os.path.getsize(path)
|
st = os.stat(path)
|
||||||
|
size = st.st_blocks * st.st_blksize
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
for thisfile in os.listdir(path):
|
for thisfile in os.listdir(path):
|
||||||
filepath = os.path.join(path, thisfile)
|
filepath = os.path.join(path, thisfile)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user