Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: reiner [...] reiner-h.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: local extra fields can only be read for directories
Date: Mon, 05 Jan 2015 00:17:28 +0100
To: bug-Archive-Zip [...] rt.cpan.org
From: Reiner Herrmann <reiner [...] reiner-h.de>
Hi, I discovered that local extra fields can only be read from directories in zip archives. Here is an example: Create a simple zip archive: # mkdir -p directory/subdir{1,2} # echo content0 > directory/file0 # echo content1 > directory/subdir1/file1 # echo content2 > directory/subdir2/file2 # zip -r -0 file.zip directory/ ... Run a simple script that prints the cd and local extra fields: # cat test.pl use Archive::Zip; my $zip = Archive::Zip->new("file.zip"); foreach my $file (sort $zip->memberNames()) { my $member = $zip->memberNamed($file); print "$file:\n"; print " CD extra field: " . unpack("H*", $member->cdExtraField()) . "\n"; print " Local extra field: " . unpack("H*", $member->localExtraField()) . "\n"; } # perl test.pl directory/: CD extra field: 5554050003cec6a95475780b000104e803000004e8030000 Local extra field: 5554090003cec6a954d0c6a95475780b000104e803000004e8030000 directory/file0: CD extra field: 5554050003cec6a95475780b000104e803000004e8030000 Local extra field: directory/subdir1/: CD extra field: 5554050003d7c6a95475780b000104e803000004e8030000 Local extra field: 5554090003d7c6a954ecc6a95475780b000104e803000004e8030000 directory/subdir1/file1: CD extra field: 5554050003d7c6a95475780b000104e803000004e8030000 Local extra field: directory/subdir2/: CD extra field: 5554050003dcc6a95475780b000104e803000004e8030000 Local extra field: 5554090003dcc6a954ecc6a95475780b000104e803000004e8030000 directory/subdir2/file2: CD extra field: 5554050003dcc6a95475780b000104e803000004e8030000 Local extra field: The local extra fields of the individual files can not be accessed, even though they are really there (confirmed with a hex editor). The Archive::Zip version is 1.39 on perl 5.20.1.
Download signature.asc
application/pgp-signature 181b

Message body not shown because it is not plain text.

The work around for this is to call ->contents() or ->rewindData() on the zip member.
Subject: Re: [rt.cpan.org #101292] local extra fields can only be read for directories
Date: Thu, 26 Oct 2017 19:50:42 +0000
To: bug-Archive-Zip [...] rt.cpan.org
From: Fred Moyer <fred [...] redhotpenguin.com>
I can do a release if you submit a github PR On Thu, Oct 26, 2017 at 12:34 PM Philip Gwyn via RT < bug-Archive-Zip@rt.cpan.org> wrote: Show quoted text
> Queue: Archive-Zip > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=101292 > > > The work around for this is to call ->contents() or ->rewindData() on the > zip member. >