Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was 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

@weiribao

Description

@weiribao
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions