Single-pass ZIP generation #339
Replies: 4 comments
-
I would love to have this, but lack the time and interest unfortunately. It should not be to hard, as the only thing to do is to write the sizes and CRC after the data instead of before. The only real issue lies in determining the compressed file size, as that also uses the Seek trait at the moment. |
Beta Was this translation helpful? Give feedback.
-
When writing the file, we can remember how much data was written to compute the compressed size. |
Beta Was this translation helpful? Give feedback.
-
Technically single-pass reading is possible too as most information from the central directory is duplicated in the file headers too, IIRC. |
Beta Was this translation helpful? Give feedback.
-
I'm afraid I'm going to have to put this one on the backburner for a while. |
Beta Was this translation helpful? Give feedback.
-
ZipWriter
currently expects the underlying stream to be seekable. The seekability is used to update the local file header after the file is complete (and also to determine some offsets).The ZIP file format specification supports writing an archive in one pass without seeking. This mode may be useful in some cases (for example, streaming a ZIP archive of several large files without generating the archive ahead of time).
Would you be interested in implementing this mode and lifting the seekability requirement?
Beta Was this translation helpful? Give feedback.
All reactions