Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Archive-Zip CPAN distribution.

Report information
The Basics

Nobody in particular
jonathan [...]
thilo.stapff [...]

Broken in:
Fixed in:
(no value)

Subject: Can't add new files to archives which contain files named 0,1,2,3,4,5,6,7,8,9 with no extension
Using Perl 5.81 on RHE3 and Archive::Zip 1.14 (a great module btw, well done). I noticed this bug appearing a fair bit in my error log for a site I run. Files are added to zip files before they are downloaded using the addFile method, but certain zip files always give an error similar to the ones below: Archive::Zip::Archive::overwriteAs('Archive::Zip::Archive=HASH(0x8583a4c)','/home/path_to_file/...') called at /usr/lib/perl5/site_perl/5.8.1/Archive/ line 798 Archive::Zip::Archive::overwriteAs('Archive::Zip::Archive=HASH(0x8581630)','/home/path_to_file/...') called at /usr/lib/perl5/site_perl/5.8.1/Archive/ line 798 Archive::Zip::Archive::overwriteAs('Archive::Zip::Archive=HASH(0x859ba6c)','/home/path_to_file/...') called at /usr/lib/perl5/site_perl/5.8.1/Archive/ line 798 This ONLY happens for zip files which contain files named "0","1" -> "9" with no extension. Files starting with letters but without extensions are added without any problems and give no error messages in the error log. In addition, zips containing files named "0" -> "9" but WITH any extension (0.res for example) also work fine and cause no errors. It's only those without that seem to make it all go wrong. Hopefully you can fix this, because it is quite annoying having an error log full of those messages (even though I guess it's a rare bug). Thanks in advance!
Subject: Files named "0" are not archived
If you try to archive a file named "0" (e.g. from the "transaction" directory of a subversion repository), it doesn't end up in the archive. Archive::Zip does not report an error in this case. To reproduce the problem, (1) create a directory named "dir1" (2) create a file "dir1/0" (3) run the attached script "" As result, an empty archive "" will be created. This behaviour was observed on Windows XP. Apparently the cause of the problem is located in function "Archive::Zip::_asZipDirName". It contains the following line push ( @dirs, $file || '' ); which replaces "0" with "" due to perl's interpretation of true/false values.
use strict; use Archive::Zip; my $archive = Archive::Zip->new(); my $member = $archive->addFile( 'dir1/0' ); print STDERR "\$member <", $member, ">\n"; # _DEBUG_ $archive->writeToFileNamed( '' );
Trying to clean up some RT tickets here. Is this still an issue? Does the latest revision fix the problem?

This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with to