Skip to content

Instantly share code, notes, and snippets.

@lutter
Created September 24, 2013 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lutter/6692626 to your computer and use it in GitHub Desktop.
Save lutter/6692626 to your computer and use it in GitHub Desktop.
Little test script to try out libarchive. Run as 'bundle exec ruby unpack spec/fixtures/iso/tiny.iso /tmp/isotest' from the razor-server checkout
#! /usr/bin/env jruby
require 'archive'
unless ARGV.size == 2
puts "Usage: unpack ISO DIRECTORY"
puts "Unbpack ISO into the DIRECTORY"
end
destination = Pathname.new(ARGV[1])
destination.mkpath
Archive.extract(ARGV[0], destination)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment