2 ms·
> Certain fields in the ZIP local file header require random access at write time. Isn't that what bit 3 in the general purpose bit flags if for? When that's s
by zmodem 6y ago
> Certain fields in the ZIP local file header require random access at write time.
Isn't that what bit 3 in the general purpose bit flags if for? When that's set, the CRC and compressed/uncompressed file lengths are written in a Data Descriptor block after the member file data.
- shockinglytrue 6y agoIt's been a few years, but I seem to remember there simply was no way to detect end of non-compressed content lacking a length header without first reading the TOC except substring search. This would quickly get very messy when the non-compressed content might contain another embedded ZIP, etc.
- zmodem 6y agoThat's during extraction though. There's no way to reliably decompress a ZIP without reading the Central Directory first. While scanning for the Local File Headers works for most files, it's not guaranteed to be correct since it may not match what's in the Central Directory. Also as you point out it doesn't work when the file length is not in the LFH. Streaming zip creation is well supported by the format though.