Project

General

Profile

Actions

Bug #11180

closed

Missing lines with Zlib::GzipReader

Added by exAspArk (Evgeny Li) over 9 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:69354]
Tags:

Description

Hi,

I have a script which is written in Python. It simply appends lines to archive file:

#!/usr/bin/env python

import gzip

gstoragefile = 'test.json.gz'

gf = gzip.open(gstoragefile, 'ab')
print >> gf, "foo"
gf.close

gf = gzip.open(gstoragefile, 'ab')
print >> gf, "bar"
gf.close

Later I can read this lines:

gunzip -c test.json.gz
> foo
> bar

However, reading this archive with Ruby doesn't work. Looks like Ruby can read only lines from first written batch (foo):

require "zlib"

Zlib::GzipReader.new(File.open("test.json.gz")).readlines.size
# => 1

Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #9790: Zlib::GzipReader only decompressed the first of concatenated filesCloseddrbrain (Eric Hodel)Actions

Updated by exAspArk (Evgeny Li) over 9 years ago

Looks like the issue might be similar to https://bugs.ruby-lang.org/issues/9790.

Actions #2

Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago

  • Is duplicate of Bug #9790: Zlib::GzipReader only decompressed the first of concatenated files added
Actions #3

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Status changed from Open to Closed

matz approved Zlib::GzipReader.zcat, so I merged the pull request into zlib.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0