Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong calculating of file size in du.py #110

Open
fremail opened this issue Oct 24, 2018 · 0 comments
Open

Wrong calculating of file size in du.py #110

fremail opened this issue Oct 24, 2018 · 0 comments

Comments

@fremail
Copy link
Contributor

fremail commented Oct 24, 2018

It seems you have a bug in file size calculating for files bigger than block_size

elif os.path.isfile(dir_entry.path):
            file_size = os.path.getsize(dir_entry.path)
            if file_size > block_size:
                total_size += file_size

I think the total_size should be increased by size multiple of block_size.

Something like this:

total_size += math.ceil(file_size / block_size) * block_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant