Solved

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

Posted on 2004-08-11
6
279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Six Sigma Control Plans

717 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