Open kleisauke opened 1 year ago
This won't work for modifying existing zip archives (since I don't see a way to replace the original archive with the new one), but for creating new archives it would be a meaningful enhancement.
So we're not opposed to adding this functionality, but it's not high on our priority list. Patches are welcome ;).
Description For writing, it's currently mandatory to provide the
ZIP_SOURCE_SEEK_WRITE
andZIP_SOURCE_TELL_WRITE
commands inzip_source_callback
.Solution Allow non-seekable output by making these commands optional. When the output is not seekable one can write a 'streamed' ZIP (by setting bit 3 of the general purpose bit flag) with the CRC-32, compressed size and uncompressed size filled with zero in the local header. The correct values are put in the data descriptor immediately after the compressed data.
Additional context https://github.com/nih-at/libzip/blob/b3ac716c0154cdbd70af1daf254adcccd16cb80a/lib/zip_close.c#L380-L381