tar with ruby

T

Tomas Fischer

Hi,

I have started using ruby.
A current task is to get a tar.gz file from internet and extract it.
I find the zlib class und so I can extract the downloaded file to
a .tar one.

How can I extract this file?
I found old postings on groups.google which use
Archive::Tar::Minitar. Is this still the way to handle tar file with
ruby,
or are there classes in standard lib?

What is the ruby-way: Install the extra package or call external program
tar (my ruby program is suggested to run only on Linux plattforms)?

Thanks,
Tomas
 
E

Eric Hodel

Hi,

I have started using ruby.
A current task is to get a tar.gz file from internet and extract it.
I find the zlib class und so I can extract the downloaded file to
a .tar one.

How can I extract this file?
I found old postings on groups.google which use
Archive::Tar::Minitar. Is this still the way to handle tar file with
ruby,
or are there classes in standard lib?

What is the ruby-way: Install the extra package or call external
program
tar (my ruby program is suggested to run only on Linux plattforms)?

I tend to favor calling external programs when I know they'll be there.
 
A

Austin Ziegler

T24gMi8yNy8wNiwgRXJpYyBIb2RlbCA8ZHJicmFpbkBzZWdtZW50Ny5uZXQ+IHdyb3RlOgo+IE9u
IEZlYiAyNywgMjAwNiwgYXQgMjo0NCBQTSwgVG9tYXMgRmlzY2hlciB3cm90ZToKPiA+IEhvdyBj
YW4gSSBleHRyYWN0IHRoaXMgZmlsZT8KPiA+IEkgZm91bmQgb2xkIHBvc3RpbmdzIG9uIGdyb3Vw
cy5nb29nbGUgd2hpY2ggdXNlCj4gPiBBcmNoaXZlOjpUYXI6Ok1pbml0YXIuIElzIHRoaXMgc3Rp
bGwgdGhlIHdheSB0byBoYW5kbGUgdGFyIGZpbGUgd2l0aAo+ID4gcnVieSwKPiA+IG9yIGFyZSB0
aGVyZSBjbGFzc2VzIGluIHN0YW5kYXJkIGxpYj8KPiA+Cj4gPiBXaGF0IGlzIHRoZSBydWJ5LXdh
eTogSW5zdGFsbCB0aGUgZXh0cmEgcGFja2FnZSBvciBjYWxsIGV4dGVybmFsCj4gPiBwcm9ncmFt
Cj4gPiB0YXIgKG15IHJ1YnkgcHJvZ3JhbSBpcyBzdWdnZXN0ZWQgdG8gcnVuIG9ubHkgb24gTGlu
dXggcGxhdHRmb3Jtcyk/Cj4KPiBJIHRlbmQgdG8gZmF2b3IgY2FsbGluZyBleHRlcm5hbCBwcm9n
cmFtcyB3aGVuIEkga25vdyB0aGV5J2xsIGJlIHRoZXJlLgoKLi4ud2hlcmVhcyBJIHRlbmQgdG8g
cHJlZmVyIGEgcHVyZSBSdWJ5IGFwcHJvYWNoLiBJIHBsYW4gb24gaW1wcm92aW5nCkFyY2hpdmU6
OlRhcjo6TWluaXRhciBpbiB0aGUgbmVhciBmdXR1cmUgYW55d2F5IGFuZCBoYXZlIGJlZW4gZ2l2
ZW4Kc29tZSBwYXJ0aWFsIHN1cHBvcnQgZm9yIHN5bWJvbGljIGxpbmtzLgoKLWF1c3RpbgotLQpB
dXN0aW4gWmllZ2xlciAqIGhhbG9zdGF0dWVAZ21haWwuY29tCiAgICAgICAgICAgICAgICogQWx0
ZXJuYXRlOiBhdXN0aW5AaGFsb3N0YXR1ZS5jYQo=
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top