From: Brian Candler Date: 2008-09-16T23:09:39+09:00 Subject: Re: how to stream or write data into a tar.gz file as if the > So, I hacked on archive-tar-minitar for a while and came up with a > solution. You got me interested now. I just installed the archive-tar-minitar gem and it looks pretty easy to generate a tar file, without any patching of the library: require 'rubygems' require 'archive/tar/minitar' src = { "foo.txt" => "This is file foo", "bar.txt" => "This is file bar", } File.open("test.tar","w") do |tarfile| Archive::Tar::Minitar::Writer.open(tarfile) do |tar| src.each do |name, data| tar.add_file_simple(name, :size=>data.size, :mode=>0644) { |f| f.write(data) } end end end All I did was a quick poke around the API (gem server --daemon; launch web browser pointing at http://localhost:8808/) and look for something called "Writer" :-) HTH, Brian. -- Posted via http://www.ruby-forum.com/.