Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use a data descriptor for symlinks so they can be stream-unzipped
This changes the behavior of createSymlink to not use a data descriptor. Because symlinks are stored uncompressed, them not using a data descriptor means that the correect size of the symlink must be stored up-front in the local header of the file, which in turn means that the file can be stream-unzipped because the unzipper can determine when the data of the symlink ends without having random access to the zip. This itself requires a small change to the behaviour of the lower level function createHeaderRaw - it no longer set the data descriptor flag which allows calling code, such as in createSymlink, to _not_ set it. A very small extra benefit is that a few bytes are shaved off the resulting file because symlinks no longer use a data descriptor. This is to address the request at #48, which in turn is inspired by the discussion at uktrade/stream-unzip#105 (I suspect that all non-compressed files should maybe not use a data descriptor and so would allow them to be stream-unzipped, but this is left to if/when)
- Loading branch information