antelle / node-stream-zip

node.js library for fast reading of large ZIPs
Other
447 stars 63 forks source link

Skip existing files when extracting #83

Closed SteveLewisZA closed 3 years ago

SteveLewisZA commented 3 years ago

Hi there,

Is there any way to have it skip existing files when extracting? I have a scenario where I'll sometimes have certain files that I'm extracting that already exist on the drive and those files will often be in use by another process, so when it tries extracting already existing file it'll get error:

"Error: EBUSY: resource busy or locked, open 'C:\file.mp4'"

This error prevents entire extraction, would be great if it could just skip existing

Any assistance much appreciated, Steve

antelle commented 3 years ago

Hi! You can extract a zip file by file and then decide what to do with each file. In any case, even if ww implement skipping existing files during automatic extraction, it should throw an error for cases like you described (EBUSY).

antelle commented 3 years ago

Or you can use the callback api (extract), it will return the number of errors but should extract what is possible.