gautamparimoo has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I want to extract files from a .tar.gz archive one at a time and perform some computation on each file . Pls suggest a solution .. I tried the given below script but it is not sucessful.
use Archive::Tar; $input="libpst.tar.gz"; my $tar = Archive::Tar->new($input); my @files = $tar->list_files; foreach my $file (@files) { $tar->extract_file($file, "C:/extract/$input"); my $c++; print "$c"; }
The above script gives an error --> Could Not Open File C:/extract/libpst.tar.gz : Permission denied. I think i am not passing the correct extract_path as i want to extract the archive in a different directory. Please help?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Archive::Tar extract
by DrHyde (Prior) on Apr 17, 2012 at 10:25 UTC | |
by gautamparimoo (Beadle) on Apr 17, 2012 at 10:43 UTC | |
by Mr. Muskrat (Canon) on Apr 17, 2012 at 16:53 UTC | |
|
Re: Archive::Tar extract
by trizen (Hermit) on Apr 17, 2012 at 10:21 UTC | |
by gautamparimoo (Beadle) on Apr 17, 2012 at 10:39 UTC | |
by trizen (Hermit) on Apr 17, 2012 at 12:24 UTC |