Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

zlib module extracts only the first compressed data set in a gzip file #6032

Closed
weiribao opened this issue Aug 10, 2013 · 2 comments
Closed
Labels
Milestone

Comments

@weiribao
Copy link

echo "1" > 1.txt
echo "2" > 2.txt
gzip 1.txt
gzip 2.txt
cat 1.txt.gz 2.txt.gz > 3.txt.gz

Now,

gunzip 3.txt.gz

prints:
1
2

However,

var zlib = require("zlib");
var fs= require("fs")

zlib.gunzip(fs.readFileSync("3.txt.gz"), function(err, buffer){
  console.log(err);
  console.log(buffer.toString());
})

prints:
1
(empty line)

Discussions in mail list: https://groups.google.com/forum/?hl=en?hl%3Den#!topic/nodejs/4qkRR867nZg

eendeego added a commit to eendeego/node that referenced this issue Oct 31, 2013
@springmeyer
Copy link

landed here looking for this feature in node and found that the action is now over at #6442. Thanks @luismreis for your work on this!

@trevnorris trevnorris added the zlib label Feb 5, 2014
@chrisdickinson
Copy link

This should be possible as of 6f6a979.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants