On 01/06/2015 10:54 PM, Andrew Ayer wrote: >> https://rt.cpan.org/Public/Bug/Display.html?id=101292 > > Do you know what happens if you try to *set* a local extra field on a > non-directory? If is succeeds, then this patch will cause local extra > fields to be completely eliminated from non-directories, which isn't > good, but could be avoided by only trying to strip local extra fields > from directories.
In the case the local fields can't be read, they also are not (over)written:
# cat test2.pl
use Archive::Zip;
my $zip = Archive::Zip->new("file.zip");
foreach my $file (sort $zip->memberNames()) {
my $member = $zip->memberNamed($file);
$member->localExtraField($member->localExtraField());
}
$zip->overwrite();
# md5sum file.zip
53f08f73bff901447594e8751a424937 file.zip
# perl test2.pl
# md5sum file.zip
53f08f73bff901447594e8751a424937 file.zip
I also checked manually with a hex editor that the extra fields
were still there.
signature.asc
Description: OpenPGP digital signature

