From: Brian Candler Date: 2008-09-16T04:09:37+09:00 Subject: Re: how to stream or write data into a tar.gz file as if the data were from files? > Others? Although it's not what you're asking for, as you mention "zipping" maybe you could consider rubyzip: require 'zip/zipfilesystem' Zip::ZipFile.open("foo.zip") { |zfs| zfs.file.open("member.txt") { |f| f << data } zfs.commit } zip is not tar, but it does have a some advantages - in particular the ability to get random-access to any particular member without having to read through the whole thing from the start. > My feeling is that it shouldn't be that hard to write data into > a .tar.gz format in either linux or ruby without actually having any > files (i.e., everything in memory or streamed in). When reading, rubyzip lets you spool directly out of the zip. When writing, I think that behind the scenes it spools to a tempfile, and when you commit it then packs this into the archive. -- Posted via http://www.ruby-forum.com/.