in reply to How do i change the file names while untar?
On unix, the location should be /test1/test2.txt, with forward slashes.
If you use Archive::Tar, you can rename any files you like with the rename method.
where changepath() returns whatever transformed path you need (untested).use Archive::Tar; my $tar = Archive::Tar->new('tarball.tgz', 1) or die $!; $tar->rename($_, changepath($_)) for $tar->list_files; $tar->extract;
File::Spec may be useful in constructing changepath().
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do i change the file names while untar?
by BerntB (Deacon) on Oct 02, 2005 at 23:18 UTC | |
|
Re^2: How do i change the file names while untar?
by perl_99_monk (Novice) on Sep 28, 2005 at 21:22 UTC | |
by Zaxo (Archbishop) on Sep 28, 2005 at 21:31 UTC | |
by perl_99_monk (Novice) on Sep 29, 2005 at 18:40 UTC | |
by perl_99_monk (Novice) on Sep 29, 2005 at 15:23 UTC |