goadb icon indicating copy to clipboard operation
goadb copied to clipboard

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

Open darkhz opened this issue 4 years ago • 0 comments

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

darkhz avatar Aug 13 '21 11:08 darkhz