in reply to Re: tracking progress of gzip'd file
in thread tracking progress of gzip'd file

Thanks for the replies,

I have taken your advice and coded the gzip from my perl script using Compress::Zlib. However I think I may have ran into a problem already. How do I determine the uncompressed size of the gz file using this module?

js1.

  • Comment on Re: Re: tracking progress of gzip'd file

Replies are listed 'Best First'.
Re: Re: Re: tracking progress of gzip'd file
by js1 (Monk) on Feb 10, 2004 at 10:42 UTC

    I've managed to get it running gzip -l:

    $gziplist=`gzip -l $file`; $gziplist=~/.\n\s*\d*\s*(\d*)/; $filesize=$1;

      Actually, that doesn't quite work because the uncompressed value is shortened:

      $ ls -l SG_BSGL01_main_460110220000.log -rw-r--r-- 1 52359 staff 394629763 Feb 10 11:54 SG_BSGL01_main +_460110220000.log $ ls -l SG_BSGL01_main_460110220000.log.gz -rwxrwxrwx 1 52359 staff 75011313 Jan 13 15:43 SG_BSGL01_main_ +460110220000.log.gz $ gzip -l SG_BSGL01_main_460110220000.log.gz compressed uncompr. ratio uncompressed_name 75011313 3486 -57182.0% SG_BSGL01_main_460110220000.log

      How do you know what units the size is in?

      js1.