* Thomas Wolf <
tho...@viacanale.de> (11:54) schrieb:
> require 'stringio'
This is unneeded.
>require 'zlib'
>
>def inflate(filename)
> File.open(filename) do |file|
> zio = file
You could just use | zio | instead of |file| and get rid of the
assignment.
> loop do
> io = Zlib::GzipReader.new zio
> puts io.read
puts here will put another "\n" at the end of the output, use print
instead.
> unused = io.unused
> io.finish
> break if unused.nil?
> zio.pos -= unused.length
> end
> end
>end
>
>inflate "foo.gz"
Note that as said in the thread this works only for files and other
seekable sources.
So "(seq 1 5 | gzip; seq 6 10 | gzip) | yourscript.rb" won't work.
mfg, simon .... hth