----- Original Message ----- From: "Dan Jablonsky" <[EMAIL PROTECTED]> To: <perl-win32-users@listserv.ActiveState.com> Sent: Wednesday, November 15, 2006 5:37 AM Subject: extract memeber of zip archive to directory
> Hi all, > would anybody tell me how to extract a zip archive > member to a certain directory? > > I used the code below; however I can't extract the > member in other place than the present working > directory (namely, I am checking if the member has a > certain name and if true I extract it - this always > happens in the same directory where the archive > resides): > > my $zip = Archive::Zip->new(); > $zip->read($_) == 0 or die "Can't read ZIP file"; > foreach my $member ($zip->members) > { > my $zip_member = $member->fileName; > if($zip_member =~/$search_pattern/) > { > #print "\nI FOUND 1 file!\n"; > #must extract the found file from the archive Not sure, but try: my $extractedName = "$mydir\\$zip_member"; $zip->extractMember($member, $extractedName); Cheers, Rob _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs