yazl icon indicating copy to clipboard operation
yazl copied to clipboard

Any zip created by yazl has a 0kb size and is damaged/corrupted

Open Kaydax opened this issue 7 years ago • 4 comments

The title says it all. I'm trying to do a very special task for zipping files into a zip, and this seems to be a big issue I'm having. When I'm zipping the file, it seems to do nothing and just create a output zip with no contents nor it even has a size. It also is a damaged/corrupted zip

Kaydax avatar Apr 15 '18 02:04 Kaydax

Yazl has tests, so we know that it is working. Can you supply a code example that only uses yazl and no other dependencies and demonstrates this issue?

andrewrk avatar Apr 15 '18 03:04 andrewrk

This is what i have:

var zip = new yazl.ZipFile();
            zip.addFile(file, 'mods/' + file.replace('unpacked\\', '').replace('unpacked/', ''));
            zip.outputStream.pipe(fs.createWriteStream(output)).on("close", function() {
              console.log("done");
            });
            zip.end();

I'm taking a file path from fs, adding the file into a folder inside the zip called mods and then closing it. file should be path/file.jar as i am packing jar files. and I'm saving it to mods/file.jar inside of the zip itself.

There are multiple files, but it should be running it per each file

Kaydax avatar Apr 15 '18 05:04 Kaydax

I am unable to reproduce your issue.

Try running the example program examples/zip.js (try --help for command line usage). If that doesn't work, then something on your system is misconfigured. If it does work, then it should be possible to bisect the problem by gradually transforming the working code into the not working code, and testing each step along the way to see where it stops working.

thejoshwolfe avatar Apr 15 '18 18:04 thejoshwolfe

I'd say that it's fair to close this one out now ;)

ajmeese7 avatar Aug 14 '22 23:08 ajmeese7