lulalala
lulalala

Reputation: 17981

Best way to extract all contents in a zip using Ruby

I have a 200mb zip file, which I want to extract to a temporary folder for processing. I have experience with rubyzip library before. However it seems that extracting all files using it is a bit of pain according to this blog post, needing to create directory before extracting individual files:

Is there an easier way to extract all things into a directory? It needs to work on both Mac OS X and Linux, but would be better if the solution is truly cross-platform.

Upvotes: 1

Views: 790

Answers (1)

David Grayson
David Grayson

Reputation: 87396

Linux has a command line utility called unzip that will do it, IIRC. If that utility is available on Mac OS then you can just call it from ruby using system() or back ticks.

Upvotes: 2

Related Questions