Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Problem extracting zero size files from zip.

by vinoth.ree (Monsignor)
on Jul 21, 2015 at 13:00 UTC ( [id://1135599]=note: print w/replies, xml ) Need Help??


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.

All is well. I learn by answering your questions...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1135599]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-25 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found