Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The behaviour of `syswrite` depends on the platform and seems to be different when getting closer to writing about 2 GiB or more at once. On Linux, it will write at most (2**31 - 4096) bytes [1,2] and not return an error when more data was passed in but just return the amount of data that was actually written - so the original implementation was producing incomplete/corrupt files during extraction when they were larger than (2**31 - 4096) bytes. On macOS, the limit appears to be (2**31 - 1) bytes, otherwise, an error is returned. So in order to correctly extract files close to or larger than 2 GiB, it's necessary to write less than about 2 GiB at once and redo write operations until all data actually has been written. [1] https://www.man7.org/linux/man-pages/man2/write.2.html#NOTES [2] https://stackoverflow.com/questions/70368651/why-cant-linux-write-more-than-2147479552-bytes
- Loading branch information
Showing
2 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters