hi,

i have created a code to unzip the zip files to a particular destination

It is unzipping but it is skipping directories inside the zip file

what should i do. I have pasted my code

# Script to unzip the zip files to a particular destination creating t +he folder with the name of zip file use Archive::Zip; use Archive::Tar; use File::Copy; use File::Find; use File::Basename; my @ext; find(\&search, "D:/aaa"); sub search { if ((/\.zip$/) ) { push @ext, $File::Find::name; #print "@ext\n"; } } my @name1; foreach my $fname(@ext) { my ($name, $path, $suffix) = fileparse($fname, '\.[^\.]*'); my $n = "D:/a/"; my $name1 = join("/",$n,$name); # Making folder with the name of the zip file found mkdir $name1,0755; print "\n\n Made Folder "; print STDOUT $name, "\n"; my $zipname = $fname; my $destinationDirectory = $name1; my ($archive, $want, $dir) = shift; my $zip = Archive::Zip->new($zipname); foreach my $member ($zip->members) { next if $member->isDirectory; (my $extractName = $member->fileName) =~ s{.*/}{}; $member->extractToFileNamed("$destinationDirectory/$extractName"); } print "\n Extraction Completed............."; }
Thanks in Advance
Avi

In reply to problem in unzipping the zip file by avik1612

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.