zlib limitations?

S

Szymon Rozga

I have encountered a problem with zlib at work. I have to parse through
huge gzipped text files (500000+ lines). However, it seems that zlib
only reads the first 66000 or so lines.

Initially I used the code:

Zlib::GZipReader.open(file) do |f|
# process text
puts f.readlines.size
end

However:

Io_Open("zcat #{file}",'r') do |io|
puts io.readlines.size
end

I went through about 2 hours of confusion and struggling not believing
that I couldn't find what I expected using the code, but grepping
returned results. Then I somehow stumbled upon this unexpected cause of
my problems.
Is this a known issue?

-Szymon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,186
Messages
2,570,997
Members
47,586
Latest member
Gilda57E93

Latest Threads

Top