Subject: Re: bug#24371: Bad value of size with --list
From: Jim Meyering <[email-masked]>
To: messages JB <[email-masked]>
Cc: [email-masked]
Date: Mon, 5 Sep 2016 18:45:34 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

On Mon, Sep 5, 2016 at 2:39 AM, messages JB <[email-masked]> wrote:
> Hi!
>
> The size of the file restored by the option "--list" is incorrect if the
> file is more big than 4GB.
>
>    [/mnt/DATA/TEST]ll
>    total 8184100
>    -rw-r--r-- 1 jacques jacques *8380511744* févr. 16  2016 file.bin
>
>    [/mnt/DATA/TEST]gzip file.bin
>
>    [/mnt/DATA/TEST]gzip -l file.bin.gz
>              compressed        uncompressed  ratio uncompressed_name
>              2490092407 *4085544448*  39.1% file.bin
>
>    [/mnt/DATA/TEST]gzip -V
>    gzip 1.6

Thanks for the report.

However, this is a known and documented limitation in the format, so
cannot be fixed in gzip. Consider using a tool with a more modern
format, like xz.

Here is the relevant part of the documentation from "info gzip":

     The ‘gzip’ format represents the input size modulo 2^32, so the
     uncompressed size and compression ratio are listed incorrectly for
     uncompressed files 4 GiB and larger.  To work around this problem,
     you can use the following command to discover a large uncompressed
     file’s true size:

          zcat file.gz | wc -c

Since there is nothing in gzip that can be changed to address this,
I'm closing the ticket.