Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

function for ZIP file creation

by nicholas (Novice)
on Oct 14, 2005 at 12:02 UTC ( [id://500210]=perlquestion: print w/replies, xml ) Need Help??

nicholas has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks

I want to make a funtion, which will recieve the initial path and according to this path funtion will create a ZIP file from the root directory and also add the all sub-directories and files under the root directory. Zip file will be created the root level.

For example, c:\test\, a zip file named test.zip with all content under test directory.

Thanks Nicholas

2005-10-14 Retitled by planetscape, as per Monastery guidelines
Original title: 'Directory Iteration'

Replies are listed 'Best First'.
Re: function for ZIP file creation
by inman (Curate) on Oct 14, 2005 at 12:16 UTC
    Have a look at Archive::Zip. If I remember correctly, this module is installed by default with the ActiveState distribution of Perl.
Re: function for ZIP file creation
by gube (Parson) on Oct 14, 2005 at 12:39 UTC
Re: function for ZIP file creation
by Skeeve (Parson) on Oct 14, 2005 at 12:10 UTC

    Great! Do it! Thanks forthe info!

    Wait... Or do you have a question? So what is the question?

    While you think about your question... Why don't you try CPAN and see which modules might be there to help you?


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
Re: function for ZIP file creation
by ioannis (Abbot) on Oct 14, 2005 at 14:40 UTC
    The package IO::Zlib will compress files, and the package Archive::Tar will add (or extract0 files into an archive of files. Tar will compress files implicitly if IO::Zlib is already installed. This solution is not exactly what you want since it does not take a directory name as an argument; it will take a list of files as one argument, or can add files incrementally.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://500210]
Approved by Skeeve
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-23 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found