node-unzip: Unzip stops prematurely in Node 0.10.0

Unzip stops prematurely in Node 0.10.0 without an error when inflating compressed files that are larger than the zlib stream’s highWaterMark (16 kb). I believe the issue is the line self._untilStream.pipe(vars.compressedSize, inflater).pipe(entry) - the inflater stream never emits ‘end’ or ‘finish’.

Code:

if (fileSizeKnown) {
  entry.size = vars.uncompressedSize;
  self._untilStream.pipe(vars.compressedSize, inflater).pipe(entry);
}

The error surfaced while I was investigating #19.

About this issue

  • Original URL
  • State: open
  • Created 11 years ago
  • Comments: 21 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, I installed from npm, used as:

fs
            .createReadStream(req.file.path)
            .pipe(
              unzip.Extract({
                path: webBuildFolder
              }).on('close', function() {
                console.log('NOW!');
              })
            )

And getting error with Mac packed archives:

invalid signature: 0xa