@@ -119,6 +119,15 @@ See `addFile()` for info about the `metadataPath` parameter.
119
119
120
120
See ` addFile() ` for the meaning of ` mtime ` and ` mode ` .
121
121
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
+
122
131
#### addEmptyDirectory(metadataPath, [ options] )
123
132
124
133
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
215
224
Bit ` 8 ` is always set.
216
225
Filenames are always encoded in utf8, even if the result is indistinguishable from ascii.
217
226
218
- Bit ` 3 ` is set in the Local File Header.
227
+ Bit ` 3 ` is usually set in the Local File Header.
219
228
To support both a streaming input and streaming output api,
220
229
it is impossible to know the crc32 before processing the file data.
221
230
File Descriptors are given after each file data with this information, as per the spec.
222
231
But remember a complete metadata listing is still always available in the central directory record,
223
232
so if unzip implementations are relying on that, like they should,
224
233
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,
226
236
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 ) ).
227
240
228
241
All other bits are unset.
229
242
@@ -255,6 +268,8 @@ In order to create empty directories, use `addEmptyDirectory()`.
255
268
256
269
## Change History
257
270
271
+ * 2.2.0
272
+ * Avoid using general purpose bit 3 for ` addBuffer() ` calls. [ issue #13 ] ( https://github.com/thejoshwolfe/yazl/issues/13 )
258
273
* 2.1.3
259
274
* Fix bug when only addBuffer() and end() are called. [ issue #12 ] ( https://github.com/thejoshwolfe/yazl/issues/12 )
260
275
* 2.1.2
0 commit comments