in reply to Problem extracting zero size files from zip.
#!/usr/bin/perl use strict; use warnings; use Archive::Zip qw(:ERROR_CODES :CONSTANTS); my $filename = "XXXXXXXXXXXx.zip"; my $zip = Archive::Zip->new(); unless ($zip->read($filename) == AZ_OK) { die "Read error\n"; } my @members = $zip->members(); foreach (@members) { #Try to use any of the following function #unless ($_->compressedSize()) (OR) #unless($_->uncompressedSize()) }
Loop through the members, use compressedSize() or uncompressedSize() function to find the file size is zero and do what you want in if condition.
Not Tested, Just an Idea.
|
|---|