#!/usr/bin/perl -w # tar - perl only implementation of tar. # requires the Archive::Tar module from CPAN. # by Nick Ing-Simmons use Archive::Tar; use File::Find; $switches = shift @ARGV; $tarfile = "./default.tar"; $create=0; $list=0; $extract=0; $debug=0; if (!$switches) { print<1) { die "More than one of x, c and t doesn't make sense.\n"; } if ($list) { $arc = Archive::Tar->new($tarfile,$compress); print join "\n", $arc->list_files,""; } if ($extract) { $arc = Archive::Tar->new($tarfile,$compress); $arc->extract($arc->list_files); } if ($create) { my @f; $arc = Archive::Tar->new(); finddepth(sub {push @f,$File::Find::name; print $File::Find::name,"\n" if $verbose},@ARGV); $arc->add_files(@f); $arc->write($tarfile,$compress); } __END__