HI *, I’m trying to unzip a file programmatically, and having lots of
ruby-1.9.2-p136 :009 > data = StringIO.new( open( ‘test.zip’, ‘r’ ).read
ruby-1.9.2-p136 :010 > Zlib::GzipReader.new(data).read
Zlib::GzipFile::Error: not in gzip format
This is with both zlib in stdlib and pr-zlib from github.
What’s strange is that the file seems in the right format:
[[email protected]:~]$ file test.zip
test.zip: Zip archive data, at least v1.0 to extract
What I need is a supersimple solution to extract a zip file and retain
the same directory structure, no more no less
Someone worked on something like this before ?