in reply to unzipping unix files on windows
hasta la vistause Compress::Zlib; my $fil = shift || die ("need compressed file, stopped"); die "$fil not a gz'd file, stopped" unless (($fil =~ /.gz$/) || ($fil =~ /.Z$/)); (my $rootfil = $fil) =~ s/.gz$//; open OOTFIL, ">$rootfil" or die ("cannot open file for gunzip"); binmode OOTFIL or die ("cannot binmode $rootfil"); $gz = gzopen($fil, "rb") or die ("can't open $fil, $gzerrno, stopped") +; my $buffer; print OOTFIL $buffer while $gz->gzread($buffer) > 0; die "Error reading from file $file: $gzerrno\n" if $gzerrno != Z_STREA +M_END; $gz->gzclose(); close(OOTFIL);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: unzipping unix files on windows
by spikey_wan (Scribe) on Jul 05, 2004 at 13:48 UTC |