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
sean [...]

Broken in:
Fixed in:
(no value)

Subject: Archive::Zip corrupts directory only entries from JAR
When reading a JAR file with some directory-only entries and then writing it back out using A::Z (without doing anything else), the archive is corrupt and can't be read according to both the zip and jar programs. The original JAR can be read by both zip and jar. If I update the XML file inside the JAR with the zip or jar programs, it works fine, but if use A::Z I get a corrupt archive. If I create the equivalent JAR using the zip program instead of the jar program, there is no problem. (But, I'm not creating the file - it comes from OpenMake, which uses Ant). Here is the code that exposes the problem, first create any jar file called foo.jar with the command 'jar cf foo.jar <files>': ------------------------------------------ #!/usr/bin/perl -w use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); use strict; my $az_foo = Archive::Zip->new('foo.jar'); die 'write error' unless $az_foo->overwriteAs('bar_bad.jar') == AZ_OK; my ( $meta_inf_member) = $az_foo->removeMember('META-INF/'); die 'write error' unless $az_foo->overwriteAs('bar_good.jar') == AZ_OK; ------------------------- zip gives a warning on bad_bar.jar: extended local header not found for META-INF/ jar gives an error on bad_bar.jar: only DEFLATED entries can have EXT descriptor at ----------------------------- You may not agree that it is important, but I'm fighting for Perl in the Java environment and winning, but this was a snag... ----------------------------- You may also refer to this post on perl monks... Thanks Sean Blanton
On Wed Aug 22 17:01:44 2007, sblanton wrote:
Show quoted text
> jar gives an error on bad_bar.jar: > only DEFLATED entries can have EXT > descriptor > at
The described error is introduced through saving folders (or any items with a uncompressed size of 0) in STORED mode and leaving the GPBF_HAS_DATA_DESCRIPTOR_MASK unchanged. Adam fixed this in Version 1.21. Please try with a release >= 1.21 and check if the problem persists.
I believe this is resolved now.

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

Please report any issues with to