extract zip file

How to extract zip file in perl....
LVL 7
tankergoblinAsked:
Who is Participating?
 
TintinCommented:
The full program is
#!/usr/bin/perl
system "unzip /path/to/file.zip" and die "Can not unzip file.zip $!\n";

Open in new window

0
 
ValleyENTCommented:
This should be what you need, this also includes how to zip files in perl. It may be a PIA, but it will work.
http://www.perlmonks.org/?node_id=262564
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
tankergoblinAuthor Commented:
there is no example in the link you given...

mind to write small program with example..
Do you mind to show a sub module of extract zip function... thank you
0
 
TintinCommented:
If you don't want to use the Archive::Zip module, you can always just do

system "unzip file.zip" and die "Can not unzip file.zip $!\n";
0
 
tankergoblinAuthor Commented:
mind to show me some code??

can you do a dummy program for me to understand how it works?
0
 
TintinCommented:
Do you want an example with Archive::Zip or was the last example sufficient?
0
 
tankergoblinAuthor Commented:
i know where to find those example. but any try those example? does it works?

Any one mind to show me simple program on how to extract the zip file .
0
 
TintinCommented:
system "unzip file.zip" and die "Can not unzip file.zip $!\n";

will unzip a file assuming you have unzip on your system.
0
 
tankergoblinAuthor Commented:
???
The one you show me in the link is zip file not extract file
where should i put unzip file.zip can you show me the full program?
0
 
tankergoblinAuthor Commented:
is this the path i unzip my file to?unzip /path/to/file.zip
0
 
tankergoblinAuthor Commented:
how to create folder or specify path i want to store my file to.
say i have 100 files..
0
 
tankergoblinAuthor Commented:
why it extract one file only from zip, i have more than one file in zip
0
 
Adam314Commented:
The code will unzip all of the files in the named zip file to the current directory.  If you want, you can change your directory first using:
    chdir('/path/to/save/files') or die "Could not chdir: $!\n";
0
 
tankergoblinAuthor Commented:
no it does not store in current directory

say i store my zip in c:/test
but text file will unzip to c:/
0
 
tankergoblinAuthor Commented:
ok thanks i got it
but i can only extract one file
say in my zip file i have 10 files but i can only extract 1 file
how to extract all the file from zip
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.