-
Notifications
You must be signed in to change notification settings - Fork 5
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
ZipFile is not released after unzip with OneZip #4
Comments
What error do you have? Could you please simplify example and make it runnable :)? |
I want to delete the zip file after uncompress it. Here is a more intuitive code : var fs = require('fs')
function test() {
var extract = onezip.extract("myzip.zip", "folder");
extract.on('end', () => {
console.info('UNZIP end');
// DELETE THE ZIP FILE
fs.unlinkSync("myzip.zip");
try {
if (fs.existsSync("myzip.zip")) {
//file exists
console.info("Problem : the file is'nt deleted !!")
}
} catch(err) {
console.error(err)
}
});
} |
I can't reproduce this with: const fs = require('fs');
const onezip = require('onezip');
const extract = onezip.extract('./1.zip', '.');
extract.on('end', () => {
console.info('UNZIP end');
// DELETE THE ZIP FILE
fs.unlinkSync('./1.zip');
try {
if (fs.existsSync('./1.zip')) {
//file exists
console.info('Problem : the file is\'nt deleted !!');
}
} catch(err) {}
}); I see only: $ node 1
UNZIP end Doesn't matter one file in archive or a couple. |
Ok, maybe it depends on the system (specially for fs library). Moreover, i resolved the problem with a fork of OneZip. Can you change that for a future release ? Thanks! |
Unfortunately I can’t check this, but I think it worth fixing. Could you please send PR for this? |
Here is my code :
The unlink do nothing because, OneZip doesn't release the ZipFile.
Maybe you should set AutoClose in yauzl call.
Thanks.
The text was updated successfully, but these errors were encountered: