why "bad file descriptor"?

G

Geoff Cox

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?!

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;
 
G

Geoff Cox

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top