Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Zipping Files

by Rhandom (Curate)
on Sep 26, 2001 at 18:34 UTC ( [id://114818]=note: print w/replies, xml ) Need Help??


in reply to Zipping Files

For compressing files, I would have to recommend IO::Zlib. IO::Zlib provides a IO::Handle style interface for reading from and writing to zipped files. These files are compatible with gunzip on unix and are able to be decompressed by winzip as well.

I have used IO::Zlib (which is actually a front end to Compress::Zlib) very successfully under unix. I do not know what it would take to get it to run under windows though, but in theory it should be possible.

Additionally you will want to look at Archive::Tar. Archive::Tar will put all of the files into one common file, and if you have Compress::Zlib installed will compress them for you. If you save the files out with an extension of .tgz, winzip will be able to extract them (it can also do the .tar.gz extension but it is more of a hassle on win32 systems).

Again, I know that the libz libraries can work on windows, but it may be a bit of work to get them compiled.

my @a=qw(random brilliant braindead); print $a[rand(@a)];

Replies are listed 'Best First'.
Re: Re: Zipping Files
by ajt (Prior) on Sep 26, 2001 at 19:29 UTC
    On NT I have sucessfully used Archive::Tar and Compress::Zlib to make a .tar.gz file. .tar.gz files can be read by most recent versions of WinZip, and most *nix systems without a problem.

    In general, but not always, they tend to be smaller than zip files. I don't know what the conditions are that make gzip more efficient, I assume someone does, but I use .tar.gz by default as I find it's better most of the time.

    I think that Block Sorting Compression BZip2 is more efficient than either zip or Gzip on text files, but there wasn't a PPD for it for NT last time I looked, and it won't build from CPAN unless you have a compiler, and the bzip pieces to hand.

    Though it's not strictly Perl, but RedHat CygWin provides command line versions of zip, unzip, tar, gzip, bzip2 and lots of other cool *nix tools (including Perl), already compiled for Windows, and these all work okay too.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-26 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found