Open zumoshi opened 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.
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
This may be doable by translating https://github.com/madler/zlib/blob/develop/examples/zran.c to Rust.
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.
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.