Skip to content

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

Description

@darkhz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions