I'd use uncompressedSize:
#!/usr/bin/perl use strict; use Archive::Zip; foreach my $zipfnm (@ARGV) { if (-e $zipfnm) { # ZIP file exists. Proceed. my $zipobj = Archive::Zip->new($zipfnm); # ZIP obje +ct pointer my @mbrhan = $zipobj->members(); foreach my $mbrhan (@mbrhan) { # Next member found in ZIP file my $mbrfnm = $mbrhan->fileName(); my $mbrfsz = $mbrhan->uncompressedSize(); print "$mbrfnm is $mbrfsz bytes\n"; } } } exit; __END__
D:\PerlMonks>7z l -tzip test.zip 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Listing archive: test.zip -- Path = test.zip Type = zip Physical Size = 330 Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ----------------- +------- 2015-03-10 15:40:58 ....A 22 22 test.dat 2015-03-10 15:41:09 ....A 28 28 test2.dat ------------------- ----- ------------ ------------ ----------------- +------- 50 50 2 files, 0 folder +s D:\PerlMonks>zipgetsize.pl test.zip test.dat is 22 bytes test2.dat is 28 bytes D:\PerlMonks>
In reply to Re: Unzip -l replacement
by marinersk
in thread Unzip -l replacement
by sirhalos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |