senthil_v has asked for the wisdom of the Perl Monks concerning the following question:
Good Day All,
Can you please help on this issue? I had tried to extract the files from Zip. due to some reason that script does not extract the files from zip file which returned the below error.
Error Details:
format error: bad signature: 0x00000000 at offset 568276 in file AUS-000X-201512 28234755_Data.zip at C:/Perl64/lib/Archive/Zip.pm line 477.Archive::Zip::_readSignature('IO::File=GLOB(0x2a5e2a8)', 'AUS-000X-20151228234755_Data.zip') called at C:/Perl64/lib/Archive/Zip/Archive.pm line 603 Archive::Zip::Archive::readFromFileHandle('Archive::Zip::Archive=HASH(0x32c1e8)', 'IO::File=GLOB(0x2a5e2a8)', 'AUS-000X-20151228234755_Data.zip') called at C:/Perl64/lib/Archive/Zip/Archive.pm line 548 Archive::Zip::Archive::read('Archive::Zip::Archive=HASH(0x32c1e8)', 'AUS-000X-20151228234755_Data.zip') called at zip_extraction.pl line 14 Read of AUS-000X-20151228234755_Data.zip failed
use strict; use Archive::Zip qw(:ERROR_CODES); opendir(DIR, "C:\\Users\\vinayas1\\Desktop\\Automation") || die "Can't + open local directory : $!"; my @zips = grep { -f "./$_" } readdir (DIR); close(DIR); foreach my $zipfiles (grep( /\.zip$/,@zips)) { print "$zipfiles\n"; if ($zipfiles =~ /\w+\.zip$/) { my $zip = Archive::Zip->new(); my $zipName = "$zipfiles"; my $status = $zip->read( $zipName); die "Read of $zipName failed\n" if $status != AZ_OK; print "$zipfiles\n"; $zip->extractTree(); #unlink($zipfiles); } }
Thanks in Advance,
Senthil. V
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unable to Extract the Zip file
by FloydATC (Deacon) on Dec 29, 2015 at 09:28 UTC | |
by senthil_v (Sexton) on Dec 29, 2015 at 09:51 UTC | |
|
Re: Unable to Extract the Zip file
by Discipulus (Canon) on Dec 29, 2015 at 10:22 UTC | |
by senthil_v (Sexton) on Dec 29, 2015 at 12:35 UTC | |
by pmqs (Friar) on Dec 31, 2015 at 11:40 UTC | |
|
Re: Unable to Extract the Zip file
by Corion (Patriarch) on Dec 29, 2015 at 10:01 UTC | |
|
Re: Unable to Extract the Zip file (ziptest.pl)
by Anonymous Monk on Dec 29, 2015 at 09:27 UTC | |
by senthil_v (Sexton) on Dec 29, 2015 at 09:58 UTC | |
by Anonymous Monk on Dec 29, 2015 at 18:07 UTC |