On 8/9/21 8:19 AM, Adler, Mark wrote:
pigz -l doesn’t do that, but pigz -lt does. Since -t has to decode the whole 
file, -l combined with it will use that information to give the correct result. 
For compatibility, pigz -l still does what gzip does, which is to guess based 
on what it finds at the end of the file.

Perhaps gzip -l could do bounded work, as follows:

* Look at the header to see what its byte count B says.

* Decompress until it sees more than B bytes.

* If so, report that the -l sizes are bogus. If not, carry on as before.

Due to format limits, B can be at most 2**32 - 1, so this provides a bound on the amount of work, a bound that's reasonably small nowadays.



Reply via email to