2
#!/usr/bin/perl
use strict;
use warnings;
my $archive_files = "C:\\Temp\\FREMOTE\\test.zip";
sub extract_archive($$);
extract_archive($archive_files, "C:\\Temp\\FREMOTE\\TEST\\");
extract_archive("C:\\Temp\\FREMOTE\\TEST\\testb.zip",
"C:\\Temp\\FREMOTE\\TEST\\testb\\");
sub extract_archive($$) {
my $archive_file = shift;
my $extract_dir = shift;
if (! -d "$extract_dir") {
mkdir $extract_dir;
}
use Archive::Any;
my $archive = Archive::Any->new($archive_file);
if($archive->extract($extract_dir)) {
print "Extracted $archive_file into $extract_dir\n";
undef $archive;
} else {
print "Failed to extracted $archive_file into $extract_dir\n";
}
}
我得到以下錯誤。我如何解決它?存檔::任何給出IO錯誤
IO error: write error during copy : Bad file descriptor at C:/Perl/site/lib/Archive/Any.pm line 193. IO error: write error during copy : Bad file descriptor at C:/Perl/site/lib/Archive/Any.pm line 193. IO error: write error during copy : Bad file descriptor at C:/Perl/site/lib/Archive/Any.pm line 193. IO error: write error during copy : Bad file descriptor at C:/Perl/site/lib/Archive/Any.pm line 193.
在CPAN模塊中缺少鯉魚可能是我最不喜歡的perl生態系統。 – jordanm 2013-03-22 15:15:14
關於perl生態系統的真實性 – joe 2013-03-22 15:19:39
該錯誤實際上是在['Archive :: Zip :: Member'1068行](https://metacpan.org/source/Archive::Zip::Member#L1068)中指定的。事實上,鯉魚是用於錯誤,但一個調用堆棧跟蹤會有幫助...快樂的正在進行的錯誤狩獵... – amon 2013-03-22 17:10:41