Repository navigation
Support zip64 archives larger than 4 GiB - #352
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
ZIP64 archives with large valid EOCD comments can fail because locator lookup assumes it is present in the tail buffer.
1 open finding
What changed in this PR
Adds ZIP64 support so archives can exceed classic ZIP size and entry-count limits.
Changes:
- Writes ZIP64 entry metadata and end records when required.
- Reads ZIP64 directory records and extended entry fields.
- Adds coverage for classic and ZIP64 layouts.
| File | Description |
|---|---|
src/lib/io/write/zip-file-system.ts |
Emits ZIP64 metadata for overflowing fields. |
src/lib/io/read/zip-file-system.ts |
Parses ZIP64 directories and entry metadata. |
test/zip-file-system.test.mjs |
Tests ZIP64 sizes, offsets, counts, and round trips. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 7, 2026
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Removes the 4 GiB limit on zip output, so
.sogbundles and other archives written byZipFileSystemcan grow past 4 GiB or 65,535 entries.ZipFileSystemuses zip64 only where a value doesn't fit: an entry of 4 GiB or more, an entry starting past 4 GiB, or 65,535 or more entries. Archives under the limits are byte-identical to before.archive/zipand Java'sZipOutputStreamdo it: the large size is recorded after the data and in the central directory, because the header is written before the size is known.ZipReadFileSystemreads zip64 archives, so splat-transform can read back what it writes.test/zip-file-system.test.mjs. A hiddenZipFileSystem.zip64Limitsetting lets them trigger zip64 without writing 4 GiB.Tested by hand on real 4.4 GB and 4.5 GB archives with
unzip -t, Pythonzipfile.testzip()andbsdtar(direct and streamed), and by reading a 4.3 GB zip64 archive written by Python.Note: the PlayCanvas engine's zip parser doesn't support zip64 yet, so
.sogbundles over 4 GiB won't load in the engine.