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

Full support for ZIP64 archives #43

Merged
merged 2 commits into from
Jul 3, 2024
Merged

Full support for ZIP64 archives #43

merged 2 commits into from
Jul 3, 2024

Conversation

xavierleroy
Copy link
Owner

This PR builds on #39 and adds support for individual files larger than 4 Gib and for archives containing more than 65535 files, both for reading and for writing.

The new code to handle large files or large archives was lightly tested against Info-Zip (zip and unzip under Linux).

For small files and small archives, the only change is in how files are added to ZIP archives in write mode: instead of adding a data descriptor after the file data (it is unclear how to do this correctly for files larger than 4 Gib), we patch the local file header with the final sizes and CRC. The latter is what Info-Zip does, apparently.

Tiny change in the API: the "extra" data attached to files used to be exposed as a string in the entry record and as arguments to the add functions. This was not quite right, since this data is actually a list of (tag, data) blocks. For simplicity, this PR removes the "extra" field and optional arguments from the API.

Closes: #35

This adds support for individual files larger than 4 Gib and for archives containing more than 65535 files, both for reading and for writing.

When adding files to ZIP archive, stop adding a data descriptor after the file data, as it is unclear how to do this correctly for files larger than 4 Gib. Instead, patch the local file header with the final sizes and CRC.

Closes: #35
Not run systematically because they use several gigabytes of disk space.
@xavierleroy xavierleroy merged commit 062dcf5 into master Jul 3, 2024
Copy link

@AuntyEms AuntyEms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A+

@xavierleroy xavierleroy deleted the ZIP64 branch October 4, 2024 07:56
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

Successfully merging this pull request may close these issues.

ZIP64 support
2 participants