[LA.pm] calling gzip from within perl
David Heayn
david at cloudgraphics.com
Wed Jun 29 14:42:26 PDT 2005
At 8:06 AM -0700 6/29/05, Robert Spier wrote:
> > >> open(LOG, "gunzip $file |") or die "Cannot gunzip '$file': $!";
> > > open(FILE, "gunzip $fileLoc |") or die "Cannot gunzip
>'$fileLoc': $!";
>
>You really want: gunzip -c
>
Yep. this line more or less does the trick. It decompresses gz files to memory.
open(FILE, "gunzip -c $fileLoc |") or die "Cannot gunzip '$fileLoc': $!";
However, when I took it over to another server the script didn't want
to fully run. It printed a header and HTML title info, but the "data
table" was empty. This secondary server I'm futzing with doesn't
allow shell access or ssh'ing into any directories. Could this be the
reason it doesn't work? I know that some of the compressed files are
corrupt. Does the
die "Can't gunzip $fileLoc...
line test to see if there is a failed decompression attempt?
David Heayn * http://www.cloudgraphics.com * 213/925.3283
More information about the Losangeles-pm
mailing list