On Sun, 04 Dec 2005 19:56:20 +0000, Geoff Cox
<> wrote:
>Hello,
>
>I have a few hundred zip files (each one has 1 MS Word doc in it) in
>the c:\docs folder
>
>I run the following script and get "bad file descriptor" after the
>first doc file has been created from the first zip file.
>
>Any ideas why?!
Solved this myself ! In fact the errors are due to the presence of
either
the obvious - a badly formed zip file
or
any other non-zip file ... I missed this one - stupid mistake.
Cheers,
Geoff
>
>Thanks
>
>Geoff
>
>#!perl
>use warnings;
>use strict;
>use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
>use File::Find;
>
>my $dir = 'c:/docs';
>
>find sub {
>my $name = $_;
>return if -d;
>my $zip = Archive::Zip->new();
>die "Error reading $name:$!" unless $zip->read("$name") == AZ_OK;
>$zip->extractTree();
>
>}, $dir;
|