node-unzip icon indicating copy to clipboard operation
node-unzip copied to clipboard

unable to unzip zip created in MAC OS

Open whuhenrylee opened this issue 10 years ago • 1 comments

when the zip file is ziped in mac os, in windows , there will be a '__MACOX' folder in the archive, and the error event will emit. how to fixed this error,thanks

whuhenrylee avatar Jul 31 '15 06:07 whuhenrylee

Just ignore it

if(entry.type === 'File' && entry.path.slice(0,8) !== '__MACOSX') {
  console.log('Unzipping...');
  entry.pipe(fs.createWriteStream('./'+fileName))
} else {
  entry.autodrain();
}

Related reading: http://superuser.com/questions/104500/what-is-macosx-folder

msageryd avatar Oct 20 '15 10:10 msageryd