From: Dimitri Aivaliotis Date: 2006-05-02T16:47:29+09:00 Subject: Re: "All-in-one" archives library? ------=_Part_1476_13091571.1146556046708 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 5/2/06, Victor Shepelev wrote: > > Hi all. > > I'd like to see some library which handles most popular archive types > (zip, > rar, tar, gz, bz2 ...) in uniform way, just like rubyzip[1] does: > At the moment, there's archive-tar-external, which basically wraps calls to installed software with popen. So, if you have all these tools installed already, you can do something like: require 'archive/tar_external' t =3D Archive::Tar::External.new( name ) t.compressed_archive_name =3D name if name =3D~ /\.bz2/ t.uncompress( "bunzip2" ) elsif name =3D~ /\.gz/ t.uncompress( "gunzip" ) elsif name =3D~ /\.zip/ t.uncompress( "unzip" ) end if name =3D~ /\.t(ar\.)?(gz)?/ t.extract end HTH, - Dimitri ------=_Part_1476_13091571.1146556046708--