T
Thomas Wolf
Hi,
given 2 files:
cat 5lines.txt
5 lines
5 lines
5 lines
5 lines
5 lines
cat more5lines.txt
More 5 lines
More 5 lines
More 5 lines
More 5 lines
More 5 lines
These files are "gzip"ed as follows:
gzip < 5lines.txt > foo.gz
gzip < more5lines.txt >> foo.gz
zcat foo.gz:
5 lines
5 lines
5 lines
5 lines
5 lines
More 5 lines
More 5 lines
More 5 lines
More 5 lines
More 5 lines
This ruby code only reads the first 5 lines:
#!/usr/bin/ruby
require "zlib"
filename = ARGV[0]
Zlib::GzipReader.open(filename) {|gz|
print gz.read
}
../test.rb foo.gz
5 lines
5 lines
5 lines
5 lines
5 lines
How do I force Zlib::GzipReader do read the whole file?
ruby versions: 1.8.7 and 1.9.0
Thanks and regards,
Thomas Wolf
given 2 files:
cat 5lines.txt
5 lines
5 lines
5 lines
5 lines
5 lines
cat more5lines.txt
More 5 lines
More 5 lines
More 5 lines
More 5 lines
More 5 lines
These files are "gzip"ed as follows:
gzip < 5lines.txt > foo.gz
gzip < more5lines.txt >> foo.gz
zcat foo.gz:
5 lines
5 lines
5 lines
5 lines
5 lines
More 5 lines
More 5 lines
More 5 lines
More 5 lines
More 5 lines
This ruby code only reads the first 5 lines:
#!/usr/bin/ruby
require "zlib"
filename = ARGV[0]
Zlib::GzipReader.open(filename) {|gz|
print gz.read
}
../test.rb foo.gz
5 lines
5 lines
5 lines
5 lines
5 lines
How do I force Zlib::GzipReader do read the whole file?
ruby versions: 1.8.7 and 1.9.0
Thanks and regards,
Thomas Wolf