Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Compress::Zlib : what to do with the "in memory" data ?

by iburrell (Chaplain)
on Jan 08, 2005 at 00:32 UTC ( [id://420438] : note . print w/replies, xml ) Need Help??


in reply to Re^2: Compress::Zlib : what to do with the "in memory" data ?
in thread Compress::Zlib : what to do with the "in memory" data ?

Compress::Zlib and the underlying zlib library do not read or write .Z files. These are the files from the compress program, compressed using the once-patented LZW algorithm. zlib only does deflate, the algorithm used in gzip and zip files.

AFAIK, there are no Perl modules for reading or writing .Z files. One option would be to pipe through zcat or gzip, which can read .Z files.

Why do you want to use .Z files? .gz has better compression and is probably more widely supported now.

Replies are listed 'Best First'.
Re^4: Compress::Zlib : what to do with the "in memory" data ?
by ZlR (Chaplain) on Jan 08, 2005 at 13:23 UTC
    Well , a .Z file is expected by some other scripts, which i do not control.
    I think "compress" was chosen because gzip was not available as a standard command on some unices.

    Update: Since Z compressed files can be opened by gzip, the scripts i communicate with will be able to use gunzip instead of compress , wich will allow them to read both .gz and .Z files.
    And i won't have to use a system call :)

    One more update: Since i also need to tar file with Archive::Tar I finally used the compression option this module provides, which creates a tar.gz . e.g :

    $objTar->write($myfile.tar.gz,1) ;
    Thx for your answers !