6

I was wondering if anyone knows of rubyzip alternatives for Ruby, that can handle various formats in particular zip / rar / 7z?

I know of libarchive, but it's not complete for my purposes ( it's a good gem thou). (To clarify, libarchive - won't work for me - cause I need to be able to run in on Windows. ( Yeah I know sucks to be me)) Libarchive actually works on Windows, but still not for my purpose (7zip & rar formats support)

Right now I end up running system commands to the os, but I'd like something OS independent, and capable of handling those formats - reading and writing.

Thank you

konung
  • 6,908
  • 6
  • 54
  • 79
  • check http://stackoverflow.com/questions/856891/unzip-zip-tar-tag-gz-files-with-ruby – Joern Akkermann Sep 14 '11 at 17:16
  • Joern, I just tried it, and it seems that it doesn't compile neither on ruby 1.8.7 nor 1.9.2 on Windows. I have devkit isntalled for both versions and other things like gbarcode, mysql2 or nokogiri - compile without a problem. – konung Sep 14 '11 at 20:32
  • I stand correct - there is a mswin version of the gem that for some reason doesn' install by default - you need to force to download the right version of the gem. – konung Sep 15 '11 at 21:11

2 Answers2

2

Ok for anyone else interesting as of now if you need more than rubyzip you can use libarchive, but if you need to support both Windows & *nix - your best option is to go with a third-party binary. It seems that sending system commands to 7zip is easier. Also you can roll out a plugin and include binary static versions your favorite archiver. I'm going with 7zip since it's gnu and lgpl.

konung
  • 6,908
  • 6
  • 54
  • 79
0

Libarchive is available on windows:

http://gnuwin32.sourceforge.net/packages/libarchive.htm

Are you sure Ruby doesn't work with it?

Ben
  • 34,935
  • 6
  • 74
  • 113
  • I haven't tried it for a while, but at the time I was referring to the libarchive gem, not the gnu library. – konung Apr 18 '12 at 15:32