Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Zip Enlightenment

by graff (Chancellor)
on Jan 22, 2005 at 08:28 UTC ( [id://424207]=note: print w/replies, xml ) Need Help??


in reply to Zip Enlightenment

The first reply raises a good point -- your terminology seems a bit confused.

If you really do want to use GNU gzip-style compression to read and/or write files with gzip-compressed data, the easiest way to do this (IMO) is with PerlIO::gzip -- which makes use of the Perl 5.8.x "IO-layers":

#!/usr/bin/perl -w # (might as well make it "cross-platform") require 5.008 require PerlIO::gzip; open FIL, ">:gzip", "C:/test.gz" or die "oops: $!"; print FIL "This behaves like any other file handle, but output gets gz +ipped\n"; close FIL;
Note that PerlIO::gzip is not (yet) part of the Perl 5.8.x standard distribution (I wish it was) -- you have to get it from CPAN.

UPDATE: (2010-10-18) It seems that PerlIO::gzip should be viewed as superseded by PerlIO::via:gzip. (see PerlIO::gzip or PerlIO::via::gzip).

Replies are listed 'Best First'.
Re^2: Zip Enlightenment
by SamCG (Hermit) on Jan 24, 2005 at 15:08 UTC
    Thanks...

    I was (kind of) aware that gzip was different from zip -- the request actually came from a third party, who has now said standard zipping (as opposed to gzipping) is fine.

      Actually Gzip is the standart, since ZIP was built over gzip.

      Graciliano M. P.
      "Creativity is the expression of liberty".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://424207]
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: (2)
As of 2024-04-19 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found