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
Id:
50574
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
karthigan [...] yahoo.com
Cc:
CHORNY [...] cpan.org
AdminCc:

BugTracker
Severity:
Important
Broken in:
(no value)
Fixed in:
(no value)



Subject: Archive::Zip Module - addDirectory does not work in Windows XP
I am using Perl v5.10.1 from ActiveState on Windows XP Professional. The addDirectory method does not work. If I use it, I get a blank zip file with nothing inside it. Currently I have to add one file at time to get it to work using the addFile method. Please let me know if there is anything wrong in the snippet below or if there is a known compatibility issue with WinXP. Best Regards, Karthigan. Here is the code snippet: =========================================================== use Archive::Zip; $zipme = Archive::Zip->new; $zipme->addDirectory('C:/KDATA/Personal/Perl/'); $err = $zipme->writeToFileNamed("perlsource.zip"); if ($err = AZ_OK) { print "Everything is cool..files zipped\n"; } ============================================================
Hi karthigan12! Thanks for your report. See below for my commentary. On Fri Oct 16 16:59:16 2009, karthigan12 wrote:
Show quoted text
> > I am using Perl v5.10.1 from ActiveState on Windows XP Professional. The > addDirectory method does not work. If I use it, I get a blank zip file > with nothing inside it. > > Currently I have to add one file at time to get it to work using the > addFile method. Please let me know if there is anything wrong in the > snippet below or if there is a known compatibility issue with WinXP. > > Best Regards, > Karthigan. > > > > Here is the code snippet: > > =========================================================== > use Archive::Zip; > > $zipme = Archive::Zip->new; > $zipme->addDirectory('C:/KDATA/Personal/Perl/'); > $err = $zipme->writeToFileNamed("perlsource.zip"); > > if ($err = AZ_OK) { > > print "Everything is cool..files zipped\n"; > > } > > ============================================================
This code has several issues: 1. It doesn't use "strict" and "warnings". Please add them. 2. if ($err = AZ_OK) does an assignment inside the conditional - not a comparison. As such it will always succeed or fail based on whether AZ_OK is true or false. Please fix this problem and see if the same thing happen. You may also wish to run it under a different OS in a Virtual Machine for (such as the costless and open-source VirtualBox). Regards, -- Shlomi Fish
Subject: Re: [rt.cpan.org #50574] Archive::Zip Module - addDirectory does not work in Windows XP
Date: Mon, 19 Oct 2009 12:32:20 -0700 (PDT)
To: bug-Archive-Zip@rt.cpan.org, SMPETERS@cpan.org
From: Karthigan Srinivasan <karthigan@yahoo.com>
I applied the changes that you recommended and I still see the same problem in Windows XP.

Best Regards,
Karthigan.

==================================================
use strict;
use warnings;

use Archive::Zip;
use File::Next;

my $zipme = Archive::Zip->new;

$zipme->addDirectory('C:/KDATA/Personal/Perl/');
my $err = $zipme->writeToFileNamed("perlsource.zip");

if ($err == $zipme->AZ_OK) {
    print "Everything is cool..files zipped\n";
}



================================================
--- On Sat, 10/17/09, Shlomi Fish via RT <bug-Archive-Zip@rt.cpan.org> wrote:
Show quoted text

From: Shlomi Fish via RT <bug-Archive-Zip@rt.cpan.org>
Subject: [rt.cpan.org #50574] Archive::Zip Module - addDirectory does not work in Windows XP
To: karthigan@yahoo.com
Cc: SMPETERS@cpan.org
Date: Saturday, October 17, 2009, 6:47 AM

<URL: https://rt.cpan.org/Ticket/Display.html?id=50574 >

Hi karthigan12!

Thanks for your report. See below for my commentary.

On Fri Oct 16 16:59:16 2009, karthigan12 wrote:
>
> I am using Perl v5.10.1 from ActiveState on Windows XP Professional. The
> addDirectory method does not work. If I use it, I get a blank zip file
> with nothing inside it.
>
> Currently I have to add one file at time to get it to work using the
> addFile method. Please let me know if there is anything wrong in the
> snippet below or if there is a known compatibility issue with WinXP.
>
> Best Regards,
> Karthigan.
>
>
>
> Here is the code snippet:
>
> ===========================================================
> use Archive::Zip;
>
> $zipme = Archive::Zip->new;
> $zipme->addDirectory('C:/KDATA/Personal/Perl/');
> $err = $zipme->writeToFileNamed("perlsource.zip");
>
> if ($err = AZ_OK) {
>
> print "Everything is cool..files zipped\n";
>
> }
>
> ============================================================

This code has several issues:

1. It doesn't use "strict" and "warnings". Please add them.

2. if ($err = AZ_OK) does an assignment inside the conditional - not a
comparison. As such it will always succeed or fail based on whether
AZ_OK is true or false.

Please fix this problem and see if the same thing happen. You may also
wish to run it under a different OS in a Virtual Machine for (such as
the costless and open-source VirtualBox).

Regards,

-- Shlomi Fish

Птн. Окт. 16 16:59:16 2009, karthigan12 писал:
Show quoted text
> The addDirectory method does not work. If I use it, I get a blank zip
file with nothing inside it. Which version of Archive::Zip do you use? Try upgrading to 1.30, if you don't use it. -- Alexandr Ciornii, http://chorny.net
CC: SMPETERS@cpan.org
Subject: Re: [rt.cpan.org #50574] Archive::Zip Module - addDirectory does not work in Windows XP
Date: Mon, 30 Nov 2009 12:02:07 -0800 (PST)
To: bug-Archive-Zip@rt.cpan.org
From: Karthigan Srinivasan <karthigan@yahoo.com>
I have verified. I am currently using Archive::Zip version 1.30. The issue exists in version 1.30.

Best Regards,
Karthigan.


From: Alexandr Ciornii via RT <bug-Archive-Zip@rt.cpan.org>
To: karthigan@yahoo.com
Cc: SMPETERS@cpan.org
Sent: Sat, November 21, 2009 4:41:57 PM
Subject: [rt.cpan.org #50574] Archive::Zip Module - addDirectory does not work in Windows XP

<URL: https://rt.cpan.org/Ticket/Display.html?id=50574 >

Птн. Окт. 16 16:59:16 2009, karthigan12 писал:

> The addDirectory method does not work. If I use it, I get a blank zip
file with nothing inside it.

Which version of Archive::Zip do you use? Try upgrading to 1.30, if you
don't use it.

--
Alexandr Ciornii, http://chorny.net


$zipme->addDirectory('dirName'); Worked OK when I tried it. Windows XP with 5.10 ActiveState I think you may have wanted the addTree() function to add a tree of files. addDirectory() added only the new empty directory to the archive. This seems to be correct behavior for the library.


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.