GIF89a;
Direktori : /usr/share/doc/perl-IO-Compress-2.061/compress-zlib/ |
Current File : //usr/share/doc/perl-IO-Compress-2.061/compress-zlib/gzcat |
#!/usr/bin/perl use strict ; use warnings ; use Compress::Zlib ; #die "Usage: gzcat file...\n" # unless @ARGV ; my $filename ; @ARGV = '-' unless @ARGV ; foreach my $filename (@ARGV) { my $buffer ; my $gz = gzopen($filename, "rb") or die "Cannot open $filename: $gzerrno\n" ; print $buffer while $gz->gzread($buffer) > 0 ; die "Error reading from $filename: $gzerrno" . ($gzerrno+0) . "\n" if $gzerrno != Z_STREAM_END ; $gz->gzclose() ; }