in reply to tracking progress of gzip'd file
my $amount_so_far = 0; while (my $line = <>) { $amount_so_far += length($_); update_progess_bar_as_needed($amount_so_far,$total_length); }
Of course, you need to get the $total_length into your script, which you could do either by passing in the filename to your prog.pl and having it call gzip (both with -l to get the length and with -dc to do the unzipping), or by externally calling gunzip -l to get the length and passing that in as a parameter to prog.pl. I would recommend the former, BTW...
Good luck...
|
|---|