afrika has asked for the wisdom of the Perl Monks concerning the following question:
but I only obtain a void zip :(cat /home/user/d/file_list.txt /home/user/a/a.txt /home/user/b/b.txt /home/user/c/c.txt #! /usr/bin/perl use strict; use warnings; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); my $zip = Archive::Zip->new(); open (FILE_LIST, '/home/user/d/file_list.txt'); while (<FILE_LIST>) { chomp; my $member = $zip->addFile($_); print "Add error" unless ($member); } close FILE_LIST; unless ($zip->writeToFileNamed('/home/user/d/backup.zip') == AZ_OK) { die "write error";}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with creating a zip: void file
by kennethk (Abbot) on Feb 05, 2010 at 15:03 UTC | |
by afrika (Initiate) on Feb 05, 2010 at 21:38 UTC | |
by kennethk (Abbot) on Feb 05, 2010 at 22:19 UTC | |
by afrika (Initiate) on Feb 06, 2010 at 11:59 UTC |