Archive::Zip and File::Find errors
- From: Geoff Cox <gcox@xxxxxxxxxx>
- Date: Mon, 18 May 2009 21:59:01 +0100
Hello,
I am using the code below to unzip a whole series of files but am
getting an error message "can't open fred.zip: no such file or
directory" - when the file does exist and can be unzipped if it is the
only file in a folder.
Can anyone see an obvious error?
Cheers
Geoff
#!perl
use warnings;
use strict;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
use File::Find;
my $dir = 'c:/a-temp2';
my @zips;
find sub {
-d and return;
/\.zip$/ and push @zips, [$File::Find::dir, $_];
}, $dir;
my $zip = Archive::Zip->new;
for (@zips) {
chdir $_->[0] or die "can't chdir to $_->[0]: $!";
$zip->read($_->[1]) == AZ_OK or die "can't read $_->[1]";
$zip->extractTree == AZ_OK or die "can't extract $_->[1]";
}
.
- Follow-Ups:
- Re: Archive::Zip and File::Find errors
- From: Dr.Ruud
- Re: Archive::Zip and File::Find errors
- From: A. Sinan Unur
- Re: Archive::Zip and File::Find errors
- Prev by Date: Re: change file names using Archive::Zip
- Next by Date: Re: change file names using Archive::Zip
- Previous by thread: FAQ 8.8 How do I get the screen size?
- Next by thread: Re: Archive::Zip and File::Find errors
- Index(es):
Relevant Pages
|