thejoshwolfe/yazl

OS X Archive Utility fails to extract zip file

joaomoreno opened this issue · 6 comments

With the latest version 2.2.0 the following code produces a zip file that OS X's Archive Utility cannot open:

var yazl = require('yazl');
var fs = require('fs');

var zipfile = new yazl.ZipFile();

var ostream = fs.createWriteStream('out.zip');
zipfile.outputStream.pipe(ostream);

zipfile.addBuffer(new Buffer('hello'), 'hello.txt');
zipfile.end();

screen shot 2015-03-26 at 20 51 24

System log

26/03/15 20:51:23.972 Archive Utility[29825]: bomCopierFatalError:Couldn't read pkzip signature.
26/03/15 20:51:23.973 Archive Utility[29825]: bomCopierFatalError:Not a central directory signature

I ran into the same issue with Archive Utility but worked with The unarchiver or unzip xxx from terminal.

I've reproduced this problem.

@joaomoreno I believe I've fixed this issue. Please let me know if you run into any more trouble.

@thejoshwolfe NPM package hasn't updated yet =)

Ah, sorry. updated now.

Confirmed that it works for both Archive Utility and 7-Zip 9.20. 👍