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:
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:
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