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

Bad size value with (fs.FileInfo).Size() on parameter #162

Open
nacimgoura opened this issue Jun 21, 2023 · 1 comment
Open

Bad size value with (fs.FileInfo).Size() on parameter #162

nacimgoura opened this issue Jun 21, 2023 · 1 comment

Comments

@nacimgoura
Copy link

nacimgoura commented Jun 21, 2023

Hello,
thanks for this library.
I use this to have a progress bar when I read a file, but I have a little bug.
I call file.Stat() to have the file size and I put on progressbar.
image
The problem is that the size value I pass as a parameter and the size displayed in the progress bar are not the same.
The size file is 159MB but the progress bar display 152MB.
image

I don't know why this difference exist.

Also, If i call bar.Finish() on the end of my process, the total size become huge.
image

@nacimgoura nacimgoura changed the title Bad value with (fs.FileInfo).Size() on parameter Bad size value with (fs.FileInfo).Size() on parameter Jun 21, 2023
@pdevine
Copy link

pdevine commented Jul 19, 2023

The discrepancy between 159MB vs 152MB is because the actual size of the file is 159MB and 152MiB. This library shows things in bibytes instead of bytes. Given most things use KB/MB/GB/TB/PB instead of KiB/MiB/GiB/TiB/PiB, it should probably use those units instead.

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

2 participants