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
In reply to Unable to Extract the Zip file by senthil_v
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |