Repository navigation
Add ZipEntryMetadata: list a zip archive without reading its entries - #192
Merged
Merged
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
copybara-service
Bot
force-pushed
the
test_1003764259
branch
2 times, most recently
from
October 28, 2026 09:09
e9c42ad to
6d75a45
Compare
copybara-service
Bot
force-pushed
the
test_1003764259
branch
14 times, most recently
from
November 3, 2026 09:41
84e366c to
b946266
Compare
copybara-service
Bot
force-pushed
the
test_1003764259
branch
from
November 10, 2026 04:12
b946266 to
84b26d4
Compare
ZipEntryMetadata: list a zip archive without reading its entries.ZipEntryMetadata: list a zip archive without reading its entries
copybara-service
Bot
force-pushed
the
test_1003764259
branch
from
November 12, 2026 02:56
84b26d4 to
b1ae7ea
Compare
`ZipArchive::GetEntryMetadata(index)` returns an owned snapshot of one central directory record (name, comment, file/directory flags, sizes, method, CRC-32, timestamps, Unix mode, header offset, encryption flag) without opening the entry, so listing an archive no longer costs one read per entry. It does not borrow the archive, so it also works while an entry is open. The header offset is documented as an untrusted header value. `ZipFile::GetHeaderStart()` / `GetDataStart()` expose an opened entry's offsets. The Rust archives now keep their own handle on the parsed central directory (`CentralDirectory`: the zip crate's `Arc<ZipArchiveMetadata>` plus the comment) and serve `get_length` / `get_comment` / `get_entry_metadata` from it instead of through the boxed `ZipArchive`, so that C++ calling them while an entry holds a `&mut` into that box no longer aliases the borrow. PiperOrigin-RevId: 1019685384
copybara-service
Bot
force-pushed
the
test_1003764259
branch
from
November 12, 2026 03:01
b1ae7ea to
efb1966
Compare
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.
Add
ZipEntryMetadata: list a zip archive without reading its entriesZipArchive::GetEntryMetadata(index)returns an owned snapshot of one centraldirectory record (name, comment, file/directory flags, sizes, method, CRC-32,
timestamps, Unix mode, header offset, encryption flag) without opening the
entry, so listing an archive no longer costs one read per entry. It does not
borrow the archive, so it also works while an entry is open. The header offset
is documented as an untrusted header value.
ZipFile::GetHeaderStart()/GetDataStart()expose an opened entry's offsets.The Rust archives now keep their own handle on the parsed central directory
(
CentralDirectory: the zip crate'sArc<ZipArchiveMetadata>plus thecomment) and serve
get_length/get_comment/get_entry_metadatafrom itinstead of through the boxed
ZipArchive, so that C++ calling them while anentry holds a
&mutinto that box no longer aliases the borrow.