Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kaydax opened this issue Apr 15, 2018 · 4 comments
Open

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

Kaydax opened this issue Apr 15, 2018 · 4 comments

Comments

@Kaydax
Copy link

Kaydax commented Apr 15, 2018

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

@andrewrk
Copy link
Collaborator

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?

@Kaydax
Copy link
Author

Kaydax commented Apr 15, 2018

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

@thejoshwolfe
Copy link
Owner

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.

@ajmeese7
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants