Compressing Files - Help

Discussion in 'Perl Misc' started by pankaj_wolfhunter@yahoo.co.in, Apr 20, 2007.

  1. Guest

    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
     
    , Apr 20, 2007
    #1
    1. Advertising

  2. Ray Guest

    Hi,

    On Apr 20, 9:22 am, Jim Gibson <> wrote:
    > In article <>,
    >
    > <""> wrote:
    > > Greetings,
    > > In Unix we have a function called compress/gzip in
    > > order to zip a file with the a particular extension.

    >
    > 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
     
    Ray, Apr 24, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news
    Replies:
    2
    Views:
    1,093
  2. =?Utf-8?B?U2hlcg==?=

    Compressing and spanning files on upload

    =?Utf-8?B?U2hlcg==?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    485
    =?Utf-8?B?U2hlcg==?=
    Dec 28, 2005
  3. Vijay
    Replies:
    0
    Views:
    444
    Vijay
    Nov 28, 2003
  4. Arthur
    Replies:
    2
    Views:
    130
    Arthur
    Nov 30, 2003
  5. Sean O'Dwyer

    compressing data files/directories

    Sean O'Dwyer, Feb 19, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    97
    Sean O'Dwyer
    Feb 19, 2004
Loading...

Share This Page