john7701 has asked for the wisdom of the Perl Monks concerning the following question:

Help, please.
I am using ActiveState Perl on Win32 and utilizing the Archive::Zip module.
I have a master zip file that contains standard files, such as raw ASCII text, and
one or more zip files. (e.g. sub zip within a master zip)

I am successfully:
- extracting one of the sub zip files from the master zip.
- updating and replacing the file in the sub zip. This is working so I am faily confident that I am using the methods
in the proper fashion.

The error is when I am attempting to replace the sub zip in the master zip.
What is different with this step is I am adding a file that is already a zip file.
Is the module capable of adding a zip to a zip?

Here is the error displayed:

IO error: reading data : Bad file descriptor Archive::Zip::ZipFileMember::_readRawChunk('Archive::Zip::ZipFileMe +mber=HASH(0xb38a2a0)', 'SCALAR(0xb3913ac)', 32768) called at E:/Perl/ +site/lib/Archive/Zip.pm line 1774 Archive::Zip::Member::readChunk('Archive::Zip::ZipFileMember=HASH(0 +xb38a2a0)', 32768) called at E:/Perl/site/lib/Archive/Zip.pm line 206 +1 Archive::Zip::Member::_writeData('Archive::Zip::ZipFileMember=HASH( +0xb38a2a0)', 'IO::File=GLOB(0xb3a561c)') called at E:/Perl/site/lib/A +rchive/Zip.pm line 2030 Archive::Zip::Member::_writeToFileHandle('Archive::Zip::ZipFileMemb +er=HASH(0xb38a2a0)', 'IO::File=GLOB(0xb3a561c)', 1, 251050) called a +t E:/Perl/site/lib/Archive/Zip.pm line 723 Archive::Zip::Archive::writeToFileHandle('Archive::Zip::Archive=HAS +H(0x1f12968)', 'IO::File=GLOB(0xb3a561c)') called at E:/Perl/site/li +b/Archive/Zip.pm line 757 Archive::Zip::Archive::overwriteAs('Archive::Zip::Archive=HASH(0x1f +12968)', 'E:\applications\.\DailyRpts2\temp\CS0245-1_DY051217.zip') c +alled at E:/Perl/site/lib/Archive/Zip.pm line 741 Archive::Zip::Archive::overwrite('Archive::Zip::Archive=HASH(0x1f12 +968)') called at E:\applications\dailyrpts2\DailyRpts2.pl line 926 main::PrepareTrancardForLoad('E:\applications\.\DailyRpts2\temp\TRA +NCARD.ZIP', 3) called at E:\applications\dailyrpts2\DailyRpts2.pl lin +e 579 main::ProcessZipMembers() called at E:\applications\dailyrpts2\Dail +yRpts2.pl line 481 main::ProcessDYZipFiles() called at E:\applications\dailyrpts2\Dail +yRpts2.pl line 235 Undefined subroutine &Archive::Zip::Archive::_printError called at E:/ +Perl/site/lib/Archive/Zip.pm line 791.

Edited 3 Jan 2006, by footpad: Added <code> tags to make errors easier to read.

Replies are listed 'Best First'.
Re: Archive::Zip error
by mikeock (Hermit) on Jan 03, 2006 at 23:16 UTC
    Can we perhaps see the code that creates this error?
Re: Archive::Zip error
by john7701 (Novice) on Jan 04, 2006 at 18:36 UTC
    I have fixed my problem. It appears to be an install issue.

    Our calls to the module were being resolved by modules bundled in the build by ActiveState which were not up to date.
    When I queried the version in ppm it was reported that Archive-Zip was not installed.
    I installed Archive-Zip and now my script runs to completion.
    We had never installed the module since we never had issues with the calls.

    Thanks for your response. (I hope this helps others with similar symptoms but not necessarily this module.)