node-7z icon indicating copy to clipboard operation
node-7z copied to clipboard

Pause, resume and cancel extraction

Open Luury opened this issue 3 years ago • 1 comments

Any way to pause and resume extraction? through a function or child_process "signal"...

const myStream = Seven.extractFull('./archive.7z', './output/dir/', {
  $progress: true
})

myStream.pause();

myStream.resume();

myStream.stop(); 

Could be an improvement...

Luury avatar Feb 18 '22 08:02 Luury

I don't have a good answer for this but it's probably possible if you extract each file in the archive by name one at a time, and then for every file extracted save some flag like is_extracted or something. Then on pause stop extraction and on resume start extracting any files listed that do not have the flag is_extracted set.

Probably not the most performant method, and you would need a list of files/paths of everything in the archive, but it should work and is at least worth mentioning.

richies-dev avatar Dec 04 '22 22:12 richies-dev