Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How do I modify the directory structure within Archive::Tar and mofiy its "path". For example I have a set of directories that reside in C:\users\temp\DIR1\DIR2\FILE.txt. I want to tar up \DIR1\DIR2\FILE.txt, and not C:\users\temp. How can I go about this? I am using the following code:
use Archive::Tar; $JOE = $ENV{"TEMP"}; my $tar = Archive::Tar->new; #I then define $city, $category and $page_number $tar->add_files("$JOE/$city/$category/$page_number", "$JOE/$city/$cate +gory/filedesc"); $tar->write('c:\files.tar');
When I then go and look in c:\files.tar, the entire temp path along with the directories I want are there. I have tried to rename them like so:
$tar->rename( "$JOE\$city\$category\$page_number", "/$city/$catego +ry/$page_number" ); $tar->rename( "$JOE/$city/$category/filedesc", "/filedesc" );
But that gives me all kinds of path errors. Can't I specify the "path" or the files within Archive::Tar?
Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Archive::Tar and the paths within
by polettix (Vicar) on Aug 26, 2005 at 08:27 UTC | |
|
Re: Archive::Tar and the paths within
by InfiniteSilence (Curate) on Aug 25, 2005 at 21:31 UTC | |
|
Re: Archive::Tar and the paths within
by idsfa (Vicar) on Aug 26, 2005 at 15:10 UTC |