[ruby-core:96922] [Ruby master Bug#9790] Zlib::GzipReader only decompressed the first of concatenated files
From:
shyouhei@...
Date:
2020-01-17 04:51:48 UTC
List:
ruby-core #96922
Issue #9790 has been updated by shyouhei (Shyouhei Urabe).
Dan0042 (Daniel DeLorme) wrote:
> > matz: it should behave like zcat. Handling each member should be deleted.
>
> Really? I agree that `Zlib::GzipReader.open` should behave like zcat, but `each_file` is a useful additional feature to have. And it's already implemented.
I was at the meeting @ko1 is talking about. Devs at the meeting were not sure if "`each_file` is a useful additional feature to have" you say is real or not.
Do you know if there are cases when taking a random member of such gzip file is actually useful?
----------------------------------------
Bug #9790: Zlib::GzipReader only decompressed the first of concatenated files
https://bugs.ruby-lang.org/issues/9790#change-83941
* Author: quainjn (Jake Quain)
* Status: Feedback
* 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/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>