Skip Menu |

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

Report information
The Basics
Id: 12493
Status: open
Priority: 0/
Queue: Archive-Zip

People
Owner: Nobody in particular
Requestors: jonathan [...] hudghton.co.uk
thilo.stapff [...] t-online.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.14
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/Zip.pm 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/Zip.pm 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/Zip.pm 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 "test.pl" As result, an empty archive "test.zip" 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.
Subject: test.pl
use strict; use Archive::Zip; my $archive = Archive::Zip->new(); my $member = $archive->addFile( 'dir1/0' ); print STDERR "\$member <", $member, ">\n"; # _DEBUG_ $archive->writeToFileNamed( 'test.zip' );
Trying to clean up some RT tickets here. Is this still an issue? Does the latest revision fix the problem?