http://storehouse.sakura.ne.jp/viewvc/viewvc.cgi/libarchive/?root=svn
もう少しシンプルなAPIを追加するべきかなぁ?
require 'libarchive' include Archive Writer.open_filename("C:\\foo.tar.gz", COMPRESSION_GZIP, FORMAT_TAR) do |ar| ar.new_entry do |entry| entry.copy_stat("C:\\bar.txt") entry.pathname = "bar.txt" ar.write_header(entry) open("C:\\bar.txt") do |f| #ar.write_data do # f.read(8192) #end ar.write_data(f.read) end end end