我試圖使用Perl歸檔模塊解壓縮密碼保護的zip文件。 但有錯誤endedup錯誤:膨脹錯誤數據錯誤
錯誤:
inflate error data error at C:/Perl64/site/lib/Archive/Zip/Archive.pm line 367.
任何人都可以幫助我找到asolution,並解壓縮密碼保護的zip文件(用WinRAR來壓縮與密碼的文件)。
請找我使用的代碼:
my $file = "D:\\Public\\Sample-Programs\\tempzip\\TESTFILE.zip";
my $password = "aaa";
my $zip = Archive::Zip->new($file) or die "can't unzip";
foreach my $member_name ($zip->memberNames) {
my $member = $zip->memberNamed($member_name);
next if $member->isDirectory;
$member->password($password);
my $contents = $zip->contents($member) or die "error accessing $member_name";
print("contents = $contents");
}
感謝stevieb更新問題。 –