Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > why "bad file descriptor"?

Reply
Thread Tools

why "bad file descriptor"?

 
 
Geoff Cox
Guest
Posts: n/a
 
      12-04-2005
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;
 
Reply With Quote
 
 
 
 
Geoff Cox
Guest
Posts: n/a
 
      12-05-2005
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;


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Cisco 2611 and Cisco 1721 : Why , why , why ????? sam@nospam.org Cisco 10 05-01-2005 08:49 AM
Why, why, why??? =?Utf-8?B?VGltOjouLg==?= ASP .Net 6 01-27-2005 03:35 PM
Why Why Why You HAVE NO IDEA MCSE 31 04-24-2004 06:40 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57