ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: merch-redmine@jeremyevans.net
To: ruby-core@ruby-lang.org
Subject: [ruby-core:95987] [Ruby master Bug#9790] Zlib::GzipReader only decompressed the first of concatenated files
Date: Wed, 27 Nov 2019 15:38:40 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-82820.20191127153839.08c8c5450bbd8cde@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-9790.20140430205653@ruby-lang.org

Issue #9790 has been updated by jeremyevans0 (Jeremy Evans).

File zlib-gzreader-each_file-9790.patch added

Attached is a patch that adds `Zlib::GzipReader.each_file` will which handle multiple concatenated gzip streams in the same file, similar to common tools that operate on `.gz` files.  `Zlib::GzipReader.each_file` yields one `Zlib::GzipReader` instance per gzip stream in the file.

----------------------------------------
Bug #9790: Zlib::GzipReader only decompressed the first of concatenated files
https://bugs.ruby-lang.org/issues/9790#change-82820

* Author: quainjn (Jake Quain)
* Status: Assigned
* Priority: Normal
* Assignee: drbrain (Eric Hodel)
* Target version: 
* ruby -v: 2.1.1
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
There is a similar old issue in Node that I came across that perfectly describes the situation in ruby:

https://github.com/joyent/node/issues/6032

In ruby given the following setup:

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

Calling:
    
```
Zlib::GzipReader.open("3.txt.gz") do |gz|
  print gz.read
end
```

would just print:

```
1
```


---Files--------------------------------
zlib-gzreader-each_file-9790.patch (3.47 KB)


-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2019-11-27 15:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-9790.20140430205653@ruby-lang.org>
2014-04-30 20:56 ` [ruby-core:62257] [ruby-trunk - Bug #9790] [Open] Zlib::GzipReader only decompressed the first of concatenated files quainjn
2014-05-01 22:53 ` [ruby-core:62271] [ruby-trunk - Bug #9790] [Assigned] " drbrain
2015-02-24 16:17 ` [ruby-core:68286] [Ruby trunk - Bug #9790] " akostadinov
2015-02-25  6:16 ` [ruby-core:68303] " duerst
2015-05-26  9:37 ` [ruby-core:69362] " exaspark
2019-11-27 15:38 ` merch-redmine [this message]
2020-01-14  4:10 ` [ruby-core:96832] [Ruby master Bug#9790] " ko1
2020-01-14  4:33 ` [ruby-core:96833] " merch-redmine
2020-01-16  7:39 ` [ruby-core:96898] " ko1
2020-01-16 14:32 ` [ruby-core:96910] " daniel
2020-01-17  4:51 ` [ruby-core:96922] " shyouhei
2020-01-17 14:17 ` [ruby-core:96927] " daniel
2020-01-17 16:04 ` [ruby-core:96929] " merch-redmine
2020-01-18  0:51 ` [ruby-core:96933] " nobu
2020-01-18  1:07 ` [ruby-core:96934] " merch-redmine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-82820.20191127153839.08c8c5450bbd8cde@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).