Skip to content

Commit 7a243b3

Browse files
committed
update docs for issue #12 and issue #13.
1 parent ccb1475 commit 7a243b3

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ See `addFile()` for info about the `metadataPath` parameter.
119119

120120
See `addFile()` for the meaning of `mtime` and `mode`.
121121

122+
This method has the unique property that General Purpose Bit `3` will not be used in the Local File Header.
123+
This doesn't matter for unzip implementations that conform to the Zip File Spec.
124+
However, 7-Zip 9.20 has a known bug where General Purpose Bit `3` is declared an unsupported compression method
125+
(note that it really has nothing to do with the compression method.).
126+
See [issue #12](https://github.com/thejoshwolfe/yazl/issues/12).
127+
If you would like to create zip files that 7-Zip 9.20 can understand,
128+
you must use `addBuffer()` instead of `addFile()` or `addReadStream()` for all entries in the zip file
129+
(and `addEmptyDirectory()` is fine too).
130+
122131
#### addEmptyDirectory(metadataPath, [options])
123132

124133
Adds an entry to the zip file that indicates a directory should be created,
@@ -215,15 +224,19 @@ refuse to acknowledge General Purpose Bit `8`, which enables utf8 filename encod
215224
Bit `8` is always set.
216225
Filenames are always encoded in utf8, even if the result is indistinguishable from ascii.
217226

218-
Bit `3` is set in the Local File Header.
227+
Bit `3` is usually set in the Local File Header.
219228
To support both a streaming input and streaming output api,
220229
it is impossible to know the crc32 before processing the file data.
221230
File Descriptors are given after each file data with this information, as per the spec.
222231
But remember a complete metadata listing is still always available in the central directory record,
223232
so if unzip implementations are relying on that, like they should,
224233
none of this paragraph will matter anyway.
225-
Even so, Mac's Archive Utility requires File Descriptors to include the optional signature,
234+
Even so, some popular unzip implementations do not follow the spec.
235+
Mac's Archive Utility requires File Descriptors to include the optional signature,
226236
so yazl includes the optional file descriptor signature.
237+
Additionally, 7-Zip 9.20 does not seem to support general purpose bit `3` at all
238+
(it declares it an unsupported compression method, which is just wrong.
239+
See [issue #12](https://github.com/thejoshwolfe/yazl/issues/12)).
227240

228241
All other bits are unset.
229242

@@ -255,6 +268,8 @@ In order to create empty directories, use `addEmptyDirectory()`.
255268

256269
## Change History
257270

271+
* 2.2.0
272+
* Avoid using general purpose bit 3 for `addBuffer()` calls. [issue #13](https://github.com/thejoshwolfe/yazl/issues/13)
258273
* 2.1.3
259274
* Fix bug when only addBuffer() and end() are called. [issue #12](https://github.com/thejoshwolfe/yazl/issues/12)
260275
* 2.1.2

0 commit comments

Comments
 (0)