On Mar 13, 2:42 pm, "greg" <eeg... / gmail.com> wrote:
> I am trying to decompress a 80MB file (decompresses to 300MB), but I
> keep getting a buffer error.  I thought I had a workaround using
> chunks, but it fails with 20M left to go.  Any help or suggestions are
> greatly appreciated.
>
> in `read': buffer error (Zlib::BufError)
>
> class Zlib::GzipReader
>   def each_chunk(chunk_size=1024)
>     yield read(chunk_size) until eof
>   end
> end
>
> gz = Zlib::GzipReader.open(zip_file)
>
> File.open( non_zip_file, 'wb' ) do |f|
>   gz.each_chunk {|chunk| f.write(chunk)}
> end

I get good results with the rubyzip gem, extracting 300+mb files from
Zip archives...

require 'zip/zip'
zip = Zip::ZipInputStream::open(zipfile)
zip.get_next_entry
File.open(output_file, 'wb') do |f|
    f.write(zip.read)
end
zip.close

Hope that helps.

David