in reply to using Archive::Tar
use strict; use warnings; use autodie; use Archive::Tar; my @filelist = (); opendir(my $dir, '/path/to/my/dir/'); while(readdir $dir) { chomp; if (!~ /(^\.\.|\.)$/){ push @filelist, $_; } } my $pack = Archive::Tar->new; $pack->create_archive('Bundle-FinalTest.tgz', COMPRESS_GZIP, @filelist +); closedir $dir;
UPDATE: A couple of changes, but Not properly working still...
a lot of "not such file: filename" error messages, I don't know whyAlternatively, you can use the old cheap way, that is guaranteed to act as you expect:
`tar -zcvvf Bundle-FinalTest.tgz /path/to/Bundle/FinalTest/dir/`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using Archive::Tar
by Tux (Canon) on Oct 04, 2011 at 14:45 UTC | |
by ansh batra (Friar) on Oct 05, 2011 at 05:26 UTC | |
|