lakshmi_n
asked on
How to create zip files withou using Archive::zip?
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
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
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.
Assuming you have zip on the system, you can do:
system "zip", "filename.zip", @arrayoffilenames and die "Can not run zip $!\n";
system "zip", "filename.zip", @arrayoffilenames and die "Can not run zip $!\n";
ASKER
Hi,
I dont want to use any non-standard modules that does not come along with Active Perl
Thanks,
Lakshmi
I dont want to use any non-standard modules that does not come along with Active Perl
Thanks,
Lakshmi
ASKER
Using Compress:Zlib, how do I compress the files to .zip?
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 );
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 );
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.