zip-rs / zip2

Zip implementation in Rust
Other
118 stars 40 forks source link

Seek trait support for RawReader/Stored files #175

Open zumoshi opened 3 years ago

zumoshi commented 3 years ago

As per zip-rs/zip-old#221, @Plecra said ZipFile itself won't receive seek trait but seek support is possible through RawReader or a checked version that could provide another type of reader for stored files (no encryption/compression) with seek. Additionally, a method that just returns bounds (a tuple with first/last byte index of file) could be useful.

I had some issues with passing ZipFile through an UnwindSafe barrier. but a method that just returns a tuple of (u64,u64) for (start, end) of a zipfile inside archive can easily be passed then a normal file with limit could be used to read that part.

Thanks for your time.

busstoptaktik commented 3 years ago

That would definitely be very useful - I'm hoping to be able to use a zip archive as container format for large, files, kept uncompressed ("stored"), for direct, read-only access to individual bytes on disk.

So searching the zip-file by stored file's name and getting a tuple of (usize, usize) in return would be the key for me.

exFalso commented 1 year ago

Just noting that I'm picking this up in a fork as we need it. We also use zip without compression/encryption. Will submit a PR

Pr0methean commented 7 months ago

This may be doable by translating https://github.com/madler/zlib/blob/develop/examples/zran.c to Rust.

Pr0methean commented 6 months ago

This repo is no longer maintained. This is being addressed in the case of Stored files by https://github.com/zip-rs/zip2/pull/69.