473,395 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

why "bad file descriptor"?

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;
Dec 4 '05 #1
1 20511
On Sun, 04 Dec 2005 19:56:20 +0000, Geoff Cox
<ge*******@remove-this.freeuk.com> 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;


Dec 5 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Warren Oates | last post by:
I ran into an interesting gotcha with unix timestamps. I've got a page where the user inputs the date with drop-down boxes (easy to deal with), that my script sees as (say) $d $m $y, not...
6
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with...
0
by: Hardy Wang | last post by:
Hi, I have an application which encrypts some certian link to format like:...
2
by: David Reynolds | last post by:
Hi Everybody, I have a vb.net webform where I create the Excel application/workbook/worksheet. On Windows 2000 server for some reason, I keep getting an error("Bad variable type") when trying...
5
by: rod.weir | last post by:
Hello, I have the following code to iterate through each view in a SQL Server and call the "sp_refreshview" command against it. It works great until it finds a view that is damaged, or otherwise...
4
by: floppyzedolfin | last post by:
Hello! I'm actually encoding an encryption / decryption program. The encryption programes takes a file path in parameter, and encrypts the contents of the file and stores that into another file. ...
16
by: lawrence k | last post by:
I've never before written a PHP script to run on my home Ubuntu machine (though I've written dozens of PHP cron jobs for my web server), so I thought I'd start off with a very simple test: ...
6
by: James Yang | last post by:
"bad page", especially in table, is a risk for database maintenance. The particular access attempt for corrupt blocks may not occur often, and corrupt DB2 blocks are not recognized during a...
1
by: jld730 | last post by:
Hello All, I have a fairly simple script that runs fine, does what it is supposed to do, but generally on the second run (after running fine again) it throws the following error: *** Traceback...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.