Compressing Files - Help

P

pankaj_wolfhunter

Greetings,
In Unix we have a function called compress/gzip in
order to zip a file with the a particular extension.

I need to zip some files with the extension .Z in perl.

I looked through the documentation for Compress:Zlib and Archive::Zip
but didnt find how to go about it

All I want is to zip a file with a particular format like .Z

Can someone please point me to right direction?

Help would be appreciated

Sorry for posting it on comp.lang.perl.tk

TIA
 
R

Ray

Hi,

Unix 'zip', 'gzip', and 'compress' are three different programs that I
believe use three different but similar compression algorithms.

They're certainly three different programs but (as far as I know) are
two different algorithms. zip and gzip are based on one (LZ77) and
compress is based on another (LZ78). Of course, that was originally
and it is possible that a program which use to support only one
algorithm has since included code to decompress the other, as well as
many other compression schemes.
my system, 'man gzip' says that gzip can decompress files compressed
with 'compress', but not compress (create) them. There is also a 'zlib'
library that compresses stuff, and this adds to the confusion.

zlib is a library that was an implementation of the gzip algorithm.
That is, it was a C library with header and (I believe) source code so
that C programs could be made that had the compression scheme built
in. I'm not sure if zlib has changed since to include other things.

As for the original posting, I haven't followed this closely in recent
years, but compress is based on the LZW algorithm, which in turn is
based on the LZ78 algorithm. There was a patent on LZW which led to
the whole story with the GIF format but expired a few years ago...
I'm not too sure, but I think because of this patent, people tend to
stay away from LZ78 and support LZ77 more. Perhaps that is why it is
hard to find support for 'compress'? Just an opinion and not sure
enough to call it fact. :)

The original poster can read this and start following the links :) :

http://en.wikipedia.org/wiki/LZW

Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,666
Latest member
selsetu

Latest Threads

Top