in reply to tracking progress of gzip'd file

js1, why not do the unzipping within your perl script? You could call the script with the argument of the filename. That way, within the script you can first determine the file size, then keep track of how much data you've processed so far, calculating your progress. . . There's no need to have gzip pipe the data to perl.

Replies are listed 'Best First'.
Re: Re: tracking progress of gzip'd file
by Fletch (Bishop) on Feb 09, 2004 at 20:40 UTC

    The above's probably mentioning using Compress::Zlib to do the expanding rather than shelling out to gzip.

    As a somewhat related aside: the problem is that you're only going to know how much of the input file you've processed; you can't reliably know how much output you're going to get before you actually uncompress it (with gzip or bzip2; zip stores the compressed and uncompressed sizes in its header). As an extreme example, this 1483 byte uuencoded file will blow up to 1M of *'s when gunzip'd.

    Update: Never mind me, I'd forgotten about gzip -l as mentioned below. Feh, must be Monday . . .