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

(DirEntry).Size not returning correct value for sizes >= 5GB #37

Open
darkhz opened this issue Aug 13, 2021 · 0 comments
Open

(DirEntry).Size not returning correct value for sizes >= 5GB #37

darkhz opened this issue Aug 13, 2021 · 0 comments

Comments

@darkhz
Copy link

darkhz commented Aug 13, 2021

It seems there is a sort of integer overflow when attempting to query sizes of large files (>5GB).

For example:

$ du -b 5gb.img
5368709120 5gb.img

(Trying to get size for this file via (DirEntry).Size returns 1073741824)
$ du -h 6gb.img
6442450944 6gb.img

(Trying to get size for this file via (DirEntry).Size returns -2147483648)
$ du -h 10gb.img
10737418240 10gb.img

(Trying to get size for this file via (DirEntry).Size returns -2147483648)

Note: Range of int32 is -2147483648 through 2147483647.

Any workarounds/solutions to get the proper sizes?

@zach-klippenstein

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