Skip Menu |

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

Report information
The Basics
Id: 115258
Status: new
Priority: 0/
Queue: Archive-Zip

Owner: Nobody in particular
Requestors: dwheeler [...]

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

MIME-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
X-Spam-Status: No, score=-2.867 tagged_above=-99.9 required=10 tests=[AWL=-0.967, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1] autolearn=ham
X-Mailer: Apple Mail (2.3124)
X-Spam-Flag: NO
Message-ID: <51CBE982-C94F-4AF4-A33E-8FC6DE079B0A [...]>
content-type: text/plain; charset="utf-8"
X-Virus-Scanned: Debian amavisd-new at
X-Spam-Score: -2.867
Received: from localhost (localhost []) by (Postfix) with ESMTP id 90D4C2401FB for <cpan-bug+Archive-Zip [...]>; Sat, 11 Jun 2016 03:15:25 -0400 (EDT)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id uaxICve2r-IQ for <cpan-bug+Archive-Zip [...]>; Sat, 11 Jun 2016 03:15:24 -0400 (EDT)
Received: from ( []) by (Postfix) with SMTP id E93F8240114 for <bug-Archive-Zip [...]>; Sat, 11 Jun 2016 03:15:23 -0400 (EDT)
Received: (qmail 27081 invoked by alias); 11 Jun 2016 07:15:23 -0000
Received: from (HELO ( by (qpsmtpd/0.28) with ESMTP; Sat, 11 Jun 2016 00:15:13 -0700
Received: from (unknown []) by (Postfix) with ESMTP id 6CEF524F9E for <bug-Archive-Zip [...]>; Sat, 11 Jun 2016 03:15:07 -0400 (EDT)
Received: from (unknown []) by (Postfix) with ESMTP id 6442824F9D for <bug-Archive-Zip [...]>; Sat, 11 Jun 2016 03:15:07 -0400 (EDT)
Received: from [] (unknown []) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id BDE4A24F9C for <bug-Archive-Zip [...]>; Sat, 11 Jun 2016 03:15:06 -0400 (EDT)
Authentication-Results: (amavisd-new); dkim=pass header.i= [...]
Delivered-To: cpan-bug+Archive-Zip [...]
Subject: extractToFileNamed Fails for Symlink to Directory
Return-Path: <dwheeler [...]>
X-RT-Mail-Extension: archive-zip
X-Original-To: cpan-bug+Archive-Zip [...]
Dkim-Signature: v=1; a=rsa-sha1; c=relaxed;; h=from :content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; s=sasl; bh=dO51pucXfmYaABFT05s10efyFow=; b=WqZ 0kBQAQXsueIdbhOQhKkxMn3gHhBMIs0tkQJPrBmr5GBfMXBSU+npdr5AxB2M63UR YQvuOwCGM8GMrU1MZM6s/rAeqJe6NKtQW0NQIipcm0mKeGr+Xbx+05VzGhR87NSk NeCsMWbuQo0Ji2guoEzqmOWIH5qgFgCirsBX+XB4=
Date: Sat, 11 Jun 2016 00:15:04 -0700
To: bug-Archive-Zip [...]
X-Pobox-Relay-ID: 399976FA-2FA4-11E6-BE3A-EE617A1B28F4-76319746!
Content-Transfer-Encoding: quoted-printable
From: "David E. Wheeler" <dwheeler [...]>
X-RT-Original-Encoding: utf-8
X-RT-Interface: Email
Content-Length: 2023
Download (untitled) / with headers
text/plain 1.9k
Given the script below, if you download and run it on this file: You’ll see warnings like this: binmode() on closed filehandle GEN69 at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/darwin-2level/IO/ line 199. print() on closed filehandle GEN69 at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/darwin-2level/IO/ line 420. IO error: write error during copy : Bad file descriptor at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Archive/Zip/ line 1107. Archive::Zip::Member::_writeData(Archive::Zip::ZipFileMember=HASH(0x7ffc6c9d3918), IO::File=GLOB(0x7ffc6c02c388)) called at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Archive/Zip/ line 1033 Archive::Zip::Member::extractToFileHandle(Archive::Zip::ZipFileMember=HASH(0x7ffc6c9d3918), IO::File=GLOB(0x7ffc6c02c388)) called at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Archive/Zip/ line 498 Archive::Zip::Member::extractToFileNamed(Archive::Zip::ZipFileMember=HASH(0x7ffc6c9d3918), "/var/folders/zb/_t6g74x117qb5yq9tpqd259r0000gq/T/nbCmm9gICo/c"...) called at /Users/david/bin/try line 21 It appears to choke on the symlink `cat_tools-0.1.0/test/pgxntool`, which points to a directory within the zip file, `../pgxntool/test/pgxntool`. Maybe FileMember needs some smarts for handling a symlink to a directory? Here’s the script: #!/usr/bin/env perl -w use v5.20; use warnings; use utf8; use Archive::Zip qw(:ERROR_CODES); use File::Temp qw(tempdir); use File::Spec::Functions qw(catfile); my $file = shift or die "Usage: $0 ZIPFILE\n"; my $zip = Archive::Zip->new; if ($zip->read($file) != AZ_OK) { die "Error reading $file\n"; } my $dest_dir = tempdir; foreach my $member ($zip->members) { my $fn = catfile $dest_dir, split m{/} => $member->fileName; if ($member->extractToFileNamed($fn) != AZ_OK) { die "Error extracting $file\n"; } }

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to