# Library to read/write TAR files

**URL:** <https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830>\
**Category:** Ruby\
**Created:** [November 30, 2006, 10:31pm UTC](https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830 "2006-11-30T22:31:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mangoosta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Post date:** [November 30, 2006, 10:31pm UTC](https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830/1 "2006-11-30T22:31:34Z")

</div>

Hello,

I’m looking for a library to read/write TAR files. I’ve had a look on  
RubyForge and searched for one on Google but found nothing (except an  
old library that doesn’t seem to be maintained anymore). Does anyone  
know such a library?

Thanks

---

<div class="post-metadata">

**Author:** ![mangoosta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Post date:** [December 1, 2006, 1:36am UTC](https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830/2 "2006-12-01T01:36:07Z")

</div>

Michel C. wrote:

> Hello,
> 
> I’m looking for a library to read/write TAR files. I’ve had a look on  
> RubyForge and searched for one on Google but found nothing (except an  
> old library that doesn’t seem to be maintained anymore). Does anyone  
> know such a library?

Are you willing to make system calls? I ask because if you do it in pure  
Ruby, it will not be very fast. Tar does quite a lot of intensive  
processing, and if you try to integrate the compression schemes it uses,  
all the more so.

---

<div class="post-metadata">

**Author:** ![mangoosta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Post date:** [December 1, 2006, 4:29am UTC](https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830/3 "2006-12-01T04:29:40Z")

</div>

Michel C. wrote:

> Hello,
> 
> I’m looking for a library to read/write TAR files. I’ve had a look on  
> RubyForge and searched for one on Google but found nothing (except an  
> old library that doesn’t seem to be maintained anymore). Does anyone  
> know such a library?
> 
> Thanks

Do they have to be tar files, or can they be zips?

[http://rubyzip.sourceforge.net/](http://rubyzip.sourceforge.net/)

---

<div class="post-metadata">

**Author:** ![mangoosta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Post date:** [December 3, 2006, 7:21pm UTC](https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830/4 "2006-12-03T19:21:11Z")

</div>

On Fri, Dec 01, 2006 at 06:30:12AM +0900, Michel C. wrote:

> Hello,
> 
> I’m looking for a library to read/write TAR files. I’ve had a look on  
> RubyForge and searched for one on Google but found nothing (except an  
> old library that doesn’t seem to be maintained anymore). Does anyone  
> know such a library?

Archive::Tar::Minitar is what you’re looking for I believe. Its part of  
the ruwiki project.

```
http://rubyforge.org/projects/ruwiki/

```

% gem search --remote minitar  
archive-tar-minitar (0.5.1, 0.5.0)  
Provides POSIX tarchive management from Ruby programs

And from the RDoc for it:

```
Archive::Tar::Minitar is a pure-Ruby library and command-line
utility that provides the ability to deal with POSIX tar(1) archive
files.

```

I’ve used it several times with great success.

enjoy,

-jeremy

---

<div class="post-metadata">

**Author:** ![mangoosta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Post date:** [December 1, 2006, 9:06am UTC](https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830/5 "2006-12-01T09:06:58Z")

</div>

Le 1 déc. 06 à 04:29, El Gato a écrit :

> Michel C. wrote:
> 
> > I’m looking for a library to read/write TAR files. I’ve had a look on  
> > RubyForge and searched for one on Google but found nothing (except an  
> > old library that doesn’t seem to be maintained anymore). Does anyone  
> > know such a library?
> 
> Do they have to be tar files, or can they be zips?
> 
> [http://rubyzip.sourceforge.net/](http://rubyzip.sourceforge.net/)

I already generate zip files (and prefer this format over tar.gz),  
but I want to be able to generate tar files in a system independant  
way (that’s why I don’t call it using system).

Thanks

---

<div class="post-metadata">

**Author:** ![mangoosta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Post date:** [December 4, 2006, 3:58am UTC](https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830/6 "2006-12-04T03:58:12Z")

</div>

On 11/30/06, Michel C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m looking for a library to read/write TAR files. I’ve had a look on  
> RubyForge and searched for one on Google but found nothing (except an  
> old library that doesn’t seem to be maintained anymore). Does anyone  
> know such a library?

Yes. Archive::Tar::Minitar. If I ever get TRUG hackathons going again,  
we’ll be moving forward on a libarchive port to Ruby.

What do you need?

-austin

---

<div class="post-metadata">

**Author:** ![mangoosta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Post date:** [December 3, 2006, 11:29pm UTC](https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830/7 "2006-12-03T23:29:42Z")

</div>

Le 3 déc. 06 à 19:19, Jeremy H. a écrit :

> ```
> http://rubyforge.org/projects/ruwiki/
> files.
> 
> ```
> 
> I’ve used it several times with great success.

Thank you very much, this is exactly what I was looking for!

> enjoy,

Believe me, I do!

Regards

---

<div class="post-metadata">

**Author:** ![mangoosta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Post date:** [December 4, 2006, 8:54am UTC](https://www.ruby-forum.com/t/library-to-read-write-tar-files/77830/8 "2006-12-04T08:54:35Z")

</div>

Le 4 déc. 06 à 03:57, Austin Z. a écrit :

> On 11/30/06, Michel C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I’m looking for a library to read/write TAR files. I’ve had a look on  
> > RubyForge and searched for one on Google but found nothing (except an  
> > old library that doesn’t seem to be maintained anymore). Does anyone  
> > know such a library?
> 
> Yes. Archive::Tar::Minitar. If I ever get TRUG hackathons going again,  
> we’ll be moving forward on a libarchive port to Ruby.
> 
> What do you need?

Minitar is exactly what I needed, thanks.

Regards
