#!/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";
}
}
I got the following error. How do I resolve it?
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.