Solved

How to create zip files withou using Archive::zip?

Posted on 2004-08-11
6
260 Views
Last Modified: 2010-03-05
Hi techies,

I have an array of filenames, I want to create a zip file without using Archive::zip module.
Can anybody help me with code?
It is very urgent...

Thanks in advance,
Lakshmi
0
Comment
Question by:lakshmi_n
6 Comments
 
LVL 20

Expert Comment

by:jmcg
ID: 11780564
If you don't want to use Archive::Zip, does that mean that you also don't want to use Compress::Zlib or the binary Zlib or the binary executable 'zip' program? If we understood better the particular reason you want to do this with one or both hands tied behind your back, we might be able to give you a satisfactory answer.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 11780575
Assuming you have zip on the system, you can do:

system "zip", "filename.zip", @arrayoffilenames and die "Can not run zip $!\n";
0
 

Author Comment

by:lakshmi_n
ID: 11780816
Hi,

I dont want to use any non-standard modules that does not come along with Active Perl

Thanks,
Lakshmi
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:lakshmi_n
ID: 11780825
Using Compress:Zlib, how do I compress the files to .zip?
0
 
LVL 18

Expert Comment

by:kandura
ID: 11784632
You don't. Zlib is a different compression algorithm.
I suggest you use Archive::Tar (which comes with ActivePerl), and use the 'compressed' option to make a tar.gz file (which Winzip can open).

Something like this:

use Archive::Tar;

$tar = new Archive::Tar;
$tar->add_files( your files here );
$tar->write( 'yourfile.tar.gz', 1 );
0
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 11789004
Archive::Zip is a standard module that comes with ActiveState Perl (5.8.x at least)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now