Archive::Tar::Minitar README
···
============================
Archive::Tar::Minitar is a pure-Ruby library and command-line utility
that provides the ability to deal with POSIX tar(1) archive files. The
implementation is based heavily on Mauricio Fernández's implementation
in rpa-base, but has been reorganised to promote reuse in other
projects.
This release is version 0.5.0. The library can only handle files and
directories at this point. A future version will be expanded to handle
symbolic links and hard links in a portable manner. The command line
utility, minitar, can only create archives, extract from archives, and
list archive contents.
Using this library is easy. The simplest case is:
require 'zlib'
require 'archive/tar/minitar'
include Archive::Tar
# Packs everything that matches Find.find('tests')
File.open('test.tar', 'wb') { |tar| Minitar.pack('tests', tar) }
# Unpacks 'test.tar' to 'x', creating 'x' if necessary.
Minitar.unpack('test.tar', 'x')
A gzipped tar can be written with:
tgz = Zlib::GzipWriter.new(File.open('test.tgz', 'wb'))
# Warning: tgz will be closed!
Minitar.pack('tests', tgz)
tgz = Zlib::GzipReader.new(File.open('test.tgz', 'rb'))
# Warning: tgz will be closed!
Minitar.unpack(tgz, 'x')
As the case above shows, one need not write to a file. However, it will
sometimes require that one dive a little deeper into the API, as in the
case of StringIO objects. Note that I'm not providing a block with
Minitar::Output, as Minitar::Output#close automatically closes both the
Output object and the wrapped data stream object.
begin
sgz = Zlib::GzipWriter.new(StringIO.new(""))
tar = Output.new(sgz)
Find.find('tests') do |entry|
Minitar.pack_file(entry, tar)
end
ensure
# Closes both tar and sgz.
tar.close
end
Copyright
# Copyright 2004 Mauricio Julio Fernández Pradier and Austin Ziegler
#
# This program is based on and incorporates parts of RPA::Package from
# rpa-base (lib/rpa/package.rb and lib/rpa/util.rb) by Mauricio and has been
# adapted to be more generic by Austin.
#
# 'minitar' contains an adaptation of Ruby/ProgressBar by Satoru
# Takabayashi <satoru@namazu.org>, copyright © 2001 - 2004.
#
# This program is free software. It may be redistributed and/or modified
# under the terms of the GPL version 2 (or later) or Ruby's licence.
#
# $Id: README,v 1.1 2004/09/06 22:35:41 austin Exp $
-austin
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca
: as of this email, I have [ 5 ] Gmail invitations
[...]
Of course, it helps to say where the file can be found:
http://rubyforge.org/frs/?group_id=84
It should show up in the RubyGem list shortly as well, and I suspect
that Mauricio wil RPA-ify it soon, too.
-austin
···
On Mon, 6 Sep 2004 22:46:59 -0400, Austin Ziegler <halostatue@gmail.com> wrote:
Archive::Tar::Minitar README
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca
: as of this email, I have [ 4 ] Gmail invitations
Austin Ziegler wrote:
Archive::Tar::Minitar README
Archive::Tar::Minitar is a pure-Ruby library...
Love the name of the product!
···
--
Chris Ruzin
www.chrisruzin.net
Oh sure, I rpafied it some time ago *g*
batsman@tux-chan:~/src/rpa/ports$ rpa update
Getting port info from http://rpa-base.rubyforge.org/ports/ports.info\.
100% [========================================] 79727 bytes
Ports added since the last update (in the last 14 days):
archive-tar-minitar 0.5.0-1 Library and command-line utility to deal with POSIX tar(1) archive files.
batsman@tux-chan:~/src/rpa/ports$ rpa query -x archive-tar-minitar
Matching available ports:
name: archive-tar-minitar
version: 0.5.0-1
classification: Top.Library
requires:
description: Library and command-line utility to deal with POSIX tar(1) archive files.
The library can only handle files and directories at this point. A
future version will be expanded to handle symbolic links and hard links
in a portable manner. The command line utility, minitar, can only create
archives, extract from archives, and list archive contents.
batsman@tux-chan:~/src/rpa/ports$ rpa install archive-tar-minitar
Installing ports
Getting port archive-tar-minitar from http://rpa-base.rubyforge.org/ports/archive-tar-minitar_0.5.0-1.rps\.
100% [========================================] 22528 bytes
Building archive-tar-minitar (0.5.0-1).
Generating RI data files.
Generating RDoc HTML documentation.
Calculating MD5 digests.
Building package in archive-tar-minitar_0.5.0-1_i686-pc-linux-gnu.rpa.
Installing archive-tar-minitar
Reusing cached package /home/batsman/usr/lib/ruby/rpa0.0/packages/archive-tar-minitar_0.5.0-1_i686-pc-linux-gnu.rpa.
Starting lightweight (metadata only) transaction for archive-tar-minitar
Checking for file conflicts in archive-tar-minitar.
Starting transaction for archive-tar-minitar
Package /home/batsman/usr/lib/ruby/rpa0.0/packages/archive-tar-minitar_0.5.0-1_i686-pc-linux-gnu.rpa unpacked.
Finished transaction for archive-tar-minitar
Starting lightweight (metadata only) transaction for archive-tar-minitar
Finished lightweight (metadata only) transaction for archive-tar-minitar
Finished lightweight (metadata only) transaction for archive-tar-minitar
Committed changes
···
On Tue, Sep 07, 2004 at 11:54:42AM +0900, Austin Ziegler wrote:
On Mon, 6 Sep 2004 22:46:59 -0400, Austin Ziegler <halostatue@gmail.com> wrote:
> Archive::Tar::Minitar README
[...]
Of course, it helps to say where the file can be found:
http://rubyforge.org/frs/?group_id=84
It should show up in the RubyGem list shortly as well, and I suspect
that Mauricio wil RPA-ify it soon, too.
--
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com