GNU bug report logs - #32903
[PATCH] Display uncompressed size when testing

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: gzip; Reported by: Stephen Kitt <steve@HIDDEN>; Keywords: patch; dated Tue, 2 Oct 2018 06:51:02 UTC; Maintainer for gzip is bug-gzip@HIDDEN.

Message received at 32903 <at> debbugs.gnu.org:


Received: (at 32903) by debbugs.gnu.org; 24 Dec 2018 09:22:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 24 04:22:08 2018
Received: from localhost ([127.0.0.1]:34291 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gbMR4-0001Ur-8Y
	for submit <at> debbugs.gnu.org; Mon, 24 Dec 2018 04:22:06 -0500
Received: from 5.mo2.mail-out.ovh.net ([87.98.181.248]:39924)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <steve@HIDDEN>) id 1gbMR2-0001Ub-Tv
 for 32903 <at> debbugs.gnu.org; Mon, 24 Dec 2018 04:22:05 -0500
Received: from player794.ha.ovh.net (unknown [10.109.160.62])
 by mo2.mail-out.ovh.net (Postfix) with ESMTP id B61DB17884A
 for <32903 <at> debbugs.gnu.org>; Mon, 24 Dec 2018 10:22:03 +0100 (CET)
Received: from sk2.org (gw.sk2.org [88.186.243.14])
 (Authenticated sender: steve@HIDDEN)
 by player794.ha.ovh.net (Postfix) with ESMTPSA id 4DA7011B144C;
 Mon, 24 Dec 2018 09:22:00 +0000 (UTC)
Date: Mon, 24 Dec 2018 10:21:58 +0100
From: Stephen Kitt <steve@HIDDEN>
To: Sergey Ponomarev <stokito@HIDDEN>
Subject: Re: bug#32903: [PATCH] Display uncompressed size when testing
Message-ID: <20181224102158.0e44be3f@HIDDEN>
In-Reply-To: <CADR0UcWec6rgW2uPQTbk2-VYtvQfP2LrwKGP=Ra6rLCpkLCN7Q@HIDDEN>
References: <20181002064929.3257-1-steve@HIDDEN>
 <CADR0UcWqumxpenPn-JhHOFvzNiau6TWBh1gLYfPjFPn-aCG3wQ@HIDDEN>
 <20181104203934.7f668a9f@HIDDEN>
 <CADR0UcWec6rgW2uPQTbk2-VYtvQfP2LrwKGP=Ra6rLCpkLCN7Q@HIDDEN>
X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 boundary="Sig_/G_DeZ/f_Ijx/J9igkewfGow"; protocol="application/pgp-signature"
X-Ovh-Tracer-Id: 11906110042128731588
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudekuddgtdegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenuc
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 32903
Cc: 32903 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--Sig_/G_DeZ/f_Ijx/J9igkewfGow
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Sun, 4 Nov 2018 21:54:59 +0200, Sergey Ponomarev <stokito@HIDDEN> wro=
te:
> From user point of view it would be better not to enclose the size
> into brackets: it will be easier to parse the output by other tools.

Good point, here=E2=80=99s an updated patch (I hesitated between "xxx bytes=
 OK" and
"OK xxx bytes" but went with the latter in the end).

Regards,

Stephen

    Display uncompressed size when testing
   =20
    Alongside the OK message, print the real size in bytes; this provides
    a way to view the stored file's size when it's larger than 4GiB.
   =20
    Signed-off-by: Stephen Kitt <steve@HIDDEN>

diff --git a/gzip.c b/gzip.c
index e6a7761..a162154 100644
--- a/gzip.c
+++ b/gzip.c
@@ -62,6 +62,7 @@ static char const *const license_msg[] =3D {
 #include <stddef.h>
 #include <sys/stat.h>
 #include <errno.h>
+#include <inttypes.h>
=20
 #include "tailor.h"
 #include "gzip.h"
@@ -807,7 +808,7 @@ local void treat_stdin()
=20
     if (verbose) {
         if (test) {
-            fprintf(stderr, " OK\n");
+            fprintf(stderr, " OK %jd bytes\n", (intmax_t) bytes_out);
=20
         } else if (!decompress) {
             display_ratio(bytes_in-(bytes_out-header_bytes), bytes_in, std=
err);
@@ -1060,7 +1061,7 @@ local void treat_file(iname)
     /* Display statistics */
     if(verbose) {
         if (test) {
-            fprintf(stderr, " OK");
+            fprintf(stderr, " OK %jd bytes", (int_max_t) bytes_out);
         } else if (decompress) {
             display_ratio(bytes_out-(bytes_in-header_bytes), bytes_out,std=
err);
         } else {

--Sig_/G_DeZ/f_Ijx/J9igkewfGow
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEnPVX/hPLkMoq7x0ggNMC9Yhtg5wFAlwgpTYACgkQgNMC9Yht
g5xyrw/+LP5POc4AG8Wp7in+hZILSOEjMm90Wfvs8ShkTZKgsowyVqqyyTOwT9bo
KyoXfMUHLfN1TqKOX7ra8MS20UJe/d6NIZ80ookZFmg+GgorZeBYnqGeDwE8GYW/
WHGP+Egn2LXjl8L/ktsswrC1eiKe+L4D+KEUMIoDvbyh31smZpnVyO1pFGxbqBuW
Ee43y6C+mFE3j7PpOl8Bj1TaflzMBb95LF98EeafkMxEqP/NskNlHkiDiABKn2Md
/f2qdccbvc0aZancdpwVEDEKkgLbdI1lQlA7p4+Rc4zgYC2ho8FhzY3U4w+JLe6x
YQ3XmAVEnmUInekPqfnfJLDWXtVXpxQRbcBHYYpE5v0BHX80mHMqMAXyR4E+7VI2
ZWMu31OOQnjd7LU610+36Y8HkgaRfvrZ1UNCVajIgfKlbIrjsP0GZrkFm5jQvzHN
PONgcjDo0VVEbJKiC6B2Z6cwmGNRKpATfgATEjTLEAQaLk4vhoSekpmaIeJHhYQU
g0RnpMg8KdHd/GHgu7uNjATLqX3BZTGx3+mhgkFE6aglgk5+KixK1HNBzPKVKPbY
DABbkEa5mEEmXDyuSnkhUqkWoNRS9G4Wz++BY5XhxmthlwUQE4DQtVnZfariGqHr
FPzJGyszPLbzZqgosUuDBuxiGnPEBZP/qktjZrkqDeXDGHcoB8g=
=bNiA
-----END PGP SIGNATURE-----

--Sig_/G_DeZ/f_Ijx/J9igkewfGow--




Information forwarded to bug-gzip@HIDDEN:
bug#32903; Package gzip. Full text available.

Message received at 32903 <at> debbugs.gnu.org:


Received: (at 32903) by debbugs.gnu.org; 4 Nov 2018 19:55:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 04 14:55:44 2018
Received: from localhost ([127.0.0.1]:34285 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gJOUq-0006pf-7f
	for submit <at> debbugs.gnu.org; Sun, 04 Nov 2018 14:55:44 -0500
Received: from mail-ed1-f53.google.com ([209.85.208.53]:45925)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stokito@HIDDEN>) id 1gJOUn-0006pR-U2
 for 32903 <at> debbugs.gnu.org; Sun, 04 Nov 2018 14:55:42 -0500
Received: by mail-ed1-f53.google.com with SMTP id w39-v6so1361037edw.12
 for <32903 <at> debbugs.gnu.org>; Sun, 04 Nov 2018 11:55:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=vr9hXhxJJ4J6xo30rogAF3BLNZqHl4PRDVh0TLV9i+0=;
 b=myUXoKUAQDwaQGq23NNA0ZQKx2xYyrF6cFWQVcAxxBcbGM4QuL5IdEqCfg+5ZPI9Pd
 Zrpp/IkqyGS0SI0wLTZCw+Syik6k1vPG3QRUlrnvoxs2Eh543WZEVry9m14cGiJ0AER4
 Avs3MCcUnYo+fRX4xbY/P/vcYKwaPyEA5grh5sUFgA1DHXu3aeK41VsHm3V+mSu782xG
 hap+L6kN5tS8EHuAiwdVjOYHEQWKAoTBtjbG8J3u/8UCCX/A1RzZMHQn+0g/5SuFQ9Cl
 Q87H+q5F2Ig3p6u54FLc242l/FGR9x62pnmQ8TeHpBe1UW2zIgiO7vrQ9Ki1dYePtZD4
 zKIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=vr9hXhxJJ4J6xo30rogAF3BLNZqHl4PRDVh0TLV9i+0=;
 b=nwAIJj1w3O8nYZimy/F7CUrnic9SK//waLTBVGn9eswjnNSFtoAPt3TMRakDLgE2Tp
 IaWJfIE58hsKnHBeDuh512+liFevJxMuRkaYSxikzzLdPxg/twSt4ooLUCrSj/ERqOME
 kjryA5ZLHyfyXtr3dkV348XVfI53sn7Eh+8HRthrMQG4B8Po1D/vbwtmNTY41XtL7Zly
 hJ0kCVZ4kjKUUcs7PcL0jDZ1LJLMkKZ1KyQlUAB4mx1EetrPALgOnFh4npyCmJMhiHbT
 1yTT4UVodLBEjgUoTeORJSQ1Cfg5/7Q8Lp4Pu+uhLDQXWymwb3DESrV1bsPxOXn1uxAC
 n6Fw==
X-Gm-Message-State: AGRZ1gIEWOU/a8BkI78OG5jJUvmmMOvJPYwvIR7BbRuWv5n5PT16eC8z
 dh1fuRixPr+sZZHXQuI79mYtYCq77b6IBHR3e4Sn9bmS
X-Google-Smtp-Source: AJdET5eC381lXjzbX8MGkyP/GLYo929GyzUgP1M48iimiFdyICn4vnV9l+ZmhMjZjtpgTLF+X6d00mtpPcidfakfXWo=
X-Received: by 2002:a17:906:3fd3:: with SMTP id
 k19-v6mr12114749ejj.158.1541361335928; 
 Sun, 04 Nov 2018 11:55:35 -0800 (PST)
MIME-Version: 1.0
References: <20181002064929.3257-1-steve@HIDDEN>
 <CADR0UcWqumxpenPn-JhHOFvzNiau6TWBh1gLYfPjFPn-aCG3wQ@HIDDEN>
 <20181104203934.7f668a9f@HIDDEN>
In-Reply-To: <20181104203934.7f668a9f@HIDDEN>
From: Sergey Ponomarev <stokito@HIDDEN>
Date: Sun, 4 Nov 2018 21:54:59 +0200
Message-ID: <CADR0UcWec6rgW2uPQTbk2-VYtvQfP2LrwKGP=Ra6rLCpkLCN7Q@HIDDEN>
Subject: Re: bug#32903: [PATCH] Display uncompressed size when testing
To: steve@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000e60ebb0579dc26f0"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 32903
Cc: 32903 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000e60ebb0579dc26f0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks for explanation,

From user point of view it would be better not to enclose the size
into brackets: it will be easier to parse the output by other tools.

On Sun, 4 Nov 2018 at 21:39, Stephen Kitt <steve@HIDDEN> wrote:

> Hi Sergey,
>
> On Sun, 4 Nov 2018 14:49:50 +0200, Sergey Ponomarev <stokito@HIDDEN>
> wrote:
> > > Alongside the OK message, print the real size in bytes; this provides
> > a way to view the stored file's size when it's larger than 4GiB.
> >
> > You can get a real size by `gzip --list` command. Why to show the size =
in
> > `gzip --test` output? Almost all other compressors (lzop, xz, bzip2, et=
c0
> > just shows the same message:
> > filename: OK
>
> "gzip --list" only reports sizes correctly up to 4GiB; see the BUGS
> section in
> the manpage:
>
>        The  gzip  format represents the input size modulo 2^32, so the
> --list
>        option reports incorrect uncompressed sizes and compression ratios
>        for uncompressed files 4 GB and larger.
>
> > Even more, archive manages and other tools may try to parse the test
> > command output and the change may have some impact.
>
> True, I haven=E2=80=99t checked the impact much =E2=80=94 although I=E2=
=80=99ve been running gzip
> with this patch for a while without adverse effects (but that=E2=80=99s a=
necdotal).
>
> > > this provides a way to view the stored file's size when it's larger
> than
> > 4GiB.
> > I didn't get it. Can you please elaborate on this: `gzip --list` can't
> show
> > uncompressed size more than 4GiB?
>
> See above.
>
> Regards,
>
> Stephen
>


--=20
Sergey Ponomarev <https://linkedin.com/in/stokito>, skype:stokito

--000000000000e60ebb0579dc26f0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Thanks for explanation,<div><br></div><di=
v>From user point of view it would be better not to enclose the size into=
=C2=A0brackets: it will be easier to parse the output by other tools.</div>=
</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Sun, 4 Nov 2=
018 at 21:39, Stephen Kitt &lt;<a href=3D"mailto:steve@HIDDEN">steve@HIDDEN=
rg</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Sergey,<br>
<br>
On Sun, 4 Nov 2018 14:49:50 +0200, Sergey Ponomarev &lt;<a href=3D"mailto:s=
tokito@HIDDEN" target=3D"_blank">stokito@HIDDEN</a>&gt; wrote:<br>
&gt; &gt; Alongside the OK message, print the real size in bytes; this prov=
ides=C2=A0 <br>
&gt; a way to view the stored file&#39;s size when it&#39;s larger than 4Gi=
B.<br>
&gt; <br>
&gt; You can get a real size by `gzip --list` command. Why to show the size=
 in<br>
&gt; `gzip --test` output? Almost all other compressors (lzop, xz, bzip2, e=
tc0<br>
&gt; just shows the same message:<br>
&gt; filename: OK<br>
<br>
&quot;gzip --list&quot; only reports sizes correctly up to 4GiB; see the BU=
GS section in<br>
the manpage:<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0The=C2=A0 gzip=C2=A0 format represents the input=
 size modulo 2^32, so the --list<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0option reports incorrect uncompressed sizes and =
compression ratios<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0for uncompressed files 4 GB and larger.<br>
<br>
&gt; Even more, archive manages and other tools may try to parse the test<b=
r>
&gt; command output and the change may have some impact.<br>
<br>
True, I haven=E2=80=99t checked the impact much =E2=80=94 although I=E2=80=
=99ve been running gzip<br>
with this patch for a while without adverse effects (but that=E2=80=99s ane=
cdotal).<br>
<br>
&gt; &gt; this provides a way to view the stored file&#39;s size when it&#3=
9;s larger than=C2=A0 <br>
&gt; 4GiB.<br>
&gt; I didn&#39;t get it. Can you please elaborate on this: `gzip --list` c=
an&#39;t show<br>
&gt; uncompressed size more than 4GiB?<br>
<br>
See above.<br>
<br>
Regards,<br>
<br>
Stephen<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"l=
tr"><div><a href=3D"https://linkedin.com/in/stokito" target=3D"_blank">Serg=
ey=C2=A0Ponomarev</a>,=C2=A0<font face=3D"arial, helvetica, sans-serif"><a>=
skype:stokito</a></font><br></div></div></div>

--000000000000e60ebb0579dc26f0--




Information forwarded to bug-gzip@HIDDEN:
bug#32903; Package gzip. Full text available.

Message received at 32903 <at> debbugs.gnu.org:


Received: (at 32903) by debbugs.gnu.org; 4 Nov 2018 19:39:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 04 14:39:48 2018
Received: from localhost ([127.0.0.1]:34281 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gJOFP-0006Ti-Pw
	for submit <at> debbugs.gnu.org; Sun, 04 Nov 2018 14:39:47 -0500
Received: from 1.mo177.mail-out.ovh.net ([178.33.107.143]:49216)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <steve@HIDDEN>) id 1gJOFN-0006TZ-Be
 for 32903 <at> debbugs.gnu.org; Sun, 04 Nov 2018 14:39:45 -0500
Received: from player728.ha.ovh.net (unknown [10.109.159.136])
 by mo177.mail-out.ovh.net (Postfix) with ESMTP id 4B4EFD06EC
 for <32903 <at> debbugs.gnu.org>; Sun,  4 Nov 2018 20:39:44 +0100 (CET)
Received: from sk2.org (gw.sk2.org [88.186.243.14])
 (Authenticated sender: steve@HIDDEN)
 by player728.ha.ovh.net (Postfix) with ESMTPSA id 6E19F54008F;
 Sun,  4 Nov 2018 20:39:41 +0100 (CET)
Date: Sun, 4 Nov 2018 20:39:34 +0100
From: Stephen Kitt <steve@HIDDEN>
To: Sergey Ponomarev <stokito@HIDDEN>
Subject: Re: bug#32903: [PATCH] Display uncompressed size when testing
Message-ID: <20181104203934.7f668a9f@HIDDEN>
In-Reply-To: <CADR0UcWqumxpenPn-JhHOFvzNiau6TWBh1gLYfPjFPn-aCG3wQ@HIDDEN>
References: <20181002064929.3257-1-steve@HIDDEN>
 <CADR0UcWqumxpenPn-JhHOFvzNiau6TWBh1gLYfPjFPn-aCG3wQ@HIDDEN>
X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 boundary="Sig_/rZKmFD8LdPE_O9.6MSQu6F0"; protocol="application/pgp-signature"
X-Ovh-Tracer-Id: 5404038078229728708
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrjeefgddufedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenuc
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 32903
Cc: 32903 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--Sig_/rZKmFD8LdPE_O9.6MSQu6F0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Sergey,

On Sun, 4 Nov 2018 14:49:50 +0200, Sergey Ponomarev <stokito@HIDDEN> wro=
te:
> > Alongside the OK message, print the real size in bytes; this provides =
=20
> a way to view the stored file's size when it's larger than 4GiB.
>=20
> You can get a real size by `gzip --list` command. Why to show the size in
> `gzip --test` output? Almost all other compressors (lzop, xz, bzip2, etc0
> just shows the same message:
> filename: OK

"gzip --list" only reports sizes correctly up to 4GiB; see the BUGS section=
 in
the manpage:

       The  gzip  format represents the input size modulo 2^32, so the --li=
st
       option reports incorrect uncompressed sizes and compression ratios
       for uncompressed files 4 GB and larger.

> Even more, archive manages and other tools may try to parse the test
> command output and the change may have some impact.

True, I haven=E2=80=99t checked the impact much =E2=80=94 although I=E2=80=
=99ve been running gzip
with this patch for a while without adverse effects (but that=E2=80=99s ane=
cdotal).

> > this provides a way to view the stored file's size when it's larger tha=
n =20
> 4GiB.
> I didn't get it. Can you please elaborate on this: `gzip --list` can't sh=
ow
> uncompressed size more than 4GiB?

See above.

Regards,

Stephen

--Sig_/rZKmFD8LdPE_O9.6MSQu6F0
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEnPVX/hPLkMoq7x0ggNMC9Yhtg5wFAlvfSvYACgkQgNMC9Yht
g5ygMg//fOpBgVOhOpzQsCPUkbQ8vLlVfWrO4AQkf3n3e/dBgo7K0OmDoYe5qdQv
a/leWmMVmg7N8Jr/wYNAXwCuWpI6o9n80xVOZ715IdIhpQk6Y9fuFqwy3fnX+7J+
d9b4QqDRHrfo3E6aWWYHACjkVeB24lfYm3iLCcFwAqrtv9Bf2QJMEOXZaWpml/AS
L250peXN6WSHNm9AD/FViIBeIGBGyReGXza49s6kvGJHAbkwA0C/W1vcRMU4vBuC
EJ0jPsc+wo1hcwAsEhbzhwWR/e+lpB4W6pGK6xghsTqZeMPT8E3K6YGuqgciV74K
t/BRf7GMsEMVf0bh+MiAbO3KC27P2OC75jEpWQXtBmHLCEsDsSLRQ1p3aPYTHJfL
HUaA6gttjYCnRvLNpkgtZPp4/ymORlUh/zx1sLrX5LdNIHdMQBgknlkTnOBpCQyB
rMSefFXi03h89klGG45IFlXBAv9yVhmMd9KaBEEpGo5IdwKSO3L95DeNJehD1eks
ogcILZb2GtrmNeIp/b59jryYcmBc9YwEeNjHlxa742aW7p+6VtP7qwkAESY8IeCU
zAWGyALosFI1p3KUL/N6s3Dd42DV7FKdSQb6xL8EtMOLDsfT8EPfKVdZ9fOpjYHE
KKMKmfDXl98BbWlSq91zaR7L6JAgnJyH4oQgdJCJoYgusiLiVy0=
=Bjtl
-----END PGP SIGNATURE-----

--Sig_/rZKmFD8LdPE_O9.6MSQu6F0--




Information forwarded to bug-gzip@HIDDEN:
bug#32903; Package gzip. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Nov 2018 17:21:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 04 12:21:37 2018
Received: from localhost ([127.0.0.1]:34208 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gJM5g-0003FG-UG
	for submit <at> debbugs.gnu.org; Sun, 04 Nov 2018 12:21:37 -0500
Received: from eggs.gnu.org ([208.118.235.92]:48330)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stokito@HIDDEN>) id 1gJHrg-00039q-AU
 for submit <at> debbugs.gnu.org; Sun, 04 Nov 2018 07:50:52 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <stokito@HIDDEN>) id 1gJHra-00035V-8H
 for submit <at> debbugs.gnu.org; Sun, 04 Nov 2018 07:50:47 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM,
 HTML_MESSAGE autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:38402)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <stokito@HIDDEN>) id 1gJHra-00034R-2c
 for submit <at> debbugs.gnu.org; Sun, 04 Nov 2018 07:50:46 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57891)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <stokito@HIDDEN>) id 1gJHrY-0006hQ-1A
 for bug-gzip@HIDDEN; Sun, 04 Nov 2018 07:50:45 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <stokito@HIDDEN>) id 1gJHrU-0002NV-DO
 for bug-gzip@HIDDEN; Sun, 04 Nov 2018 07:50:42 -0500
Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:40869)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <stokito@HIDDEN>) id 1gJHrP-0001GT-Ga
 for bug-gzip@HIDDEN; Sun, 04 Nov 2018 07:50:35 -0500
Received: by mail-ed1-x533.google.com with SMTP id a14-v6so1072186edr.7
 for <bug-gzip@HIDDEN>; Sun, 04 Nov 2018 04:50:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=J3wrS1/r3cOls1Q4Jr8adZySVbJm06Tfv6vieJblQOA=;
 b=PDlGmfrxYWgx5p5KVAPKmDiV3OX1qwpdAaTPpK1x7NPg/PEgukxrvtUfz9HULDa9YC
 DuH8popRgr4S5pcqnpar5mcZfstCqX/IfLFuzmOmz+4bc11U667bkfDHpumlCKkR4ss2
 6y4RYvJSeVGxXBJ2kcey8vOQxQJ8KqzXokkp8xuOXT3XPtnbmECsgDQMpJGd3SuYxp84
 VRCTwIYBDqV47K8eb5Y2CwJ0Hy8p2/WsDJlsCOyynK8pKMPuzrAnzvlgwdJiOLx721lj
 eT+SsHzDdlQYtw9GyD002i848bZgYLGIEMIJWCH2HPTIYoSUYEkD9Pu6Qj1OR7eMT/v0
 AUzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=J3wrS1/r3cOls1Q4Jr8adZySVbJm06Tfv6vieJblQOA=;
 b=EVfxFuais1xly/RZI/BNqH1rdv5LEL01r1hGHj6HrgIgvToh/g0fAuT8n8SIKWHdCc
 olCdLzr7eY8qKQvYhdhH6UTXwev07fqMRZa4OoE/j/Y+0vKPke1gYnvzulHUSkBT26Ti
 ZFvC3JlkeRM6eZ1ZEHpk1Vvx4wkeLTD8Ku4vGpTLCTM+YJ/QeOi6H6zrh6odOXaGt/DW
 ey7rgTh3YaQMW0rP8qfvKrYv4K3M6hgnC9xPSyHa2/HqOA4vgMF+eNZBfXoBP3wRUea0
 FGSbggmSnuTNyBx/4MlstweocL5DdI05QFykI66O5mYcy4cD5AEbdHBUIqS3I7XxDZ83
 6MuQ==
X-Gm-Message-State: AGRZ1gK2DGWLNHfzdk/AdZ2LoMIg6IjzGT9m2bQWAHTOBIcsGc401BYm
 OsVhpH6JJ6vyrEQBzITJz9Gp4aWG2OoTDVrDZfEdrYuY
X-Google-Smtp-Source: AJdET5fqKdX/rcs30OHUzJ5m7KRHhf9ODcD6xgULn1gqbmaLcTFMoBj3o8L0aBL31D3NbJK7PfBmkqWYuCeQOZFz5mQ=
X-Received: by 2002:a17:906:2201:: with SMTP id
 s1-v6mr11674944ejs.31.1541335826067; 
 Sun, 04 Nov 2018 04:50:26 -0800 (PST)
MIME-Version: 1.0
From: Sergey Ponomarev <stokito@HIDDEN>
Date: Sun, 4 Nov 2018 14:49:50 +0200
Message-ID: <CADR0UcWqumxpenPn-JhHOFvzNiau6TWBh1gLYfPjFPn-aCG3wQ@HIDDEN>
Subject: bug#32903: [PATCH] Display uncompressed size when testing
To: bug-gzip@HIDDEN
Content-Type: multipart/alternative; boundary="0000000000006476330579d63637"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 04 Nov 2018 12:21:35 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

--0000000000006476330579d63637
Content-Type: text/plain; charset="UTF-8"

> Alongside the OK message, print the real size in bytes; this provides
a way to view the stored file's size when it's larger than 4GiB.

You can get a real size by `gzip --list` command. Why to show the size in
`gzip --test` output? Almost all other compressors (lzop, xz, bzip2, etc0
just shows the same message:
filename: OK

Even more, archive manages and other tools may try to parse the test
command output and the change may have some impact.

> this provides a way to view the stored file's size when it's larger than
4GiB.
I didn't get it. Can you please elaborate on this: `gzip --list` can't show
uncompressed size more than 4GiB?

Regards, Sergey

--0000000000006476330579d63637
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div>&gt; Alongside the =
OK message, print the real size in bytes; this provides</div><div>a way to =
view the stored file&#39;s size when it&#39;s larger than 4GiB.</div><div><=
br></div><div>You can get a real size by `gzip --list` command. Why to show=
 the size in `gzip --test` output? Almost all other compressors (lzop, xz, =
bzip2, etc0 just shows the same message:</div><div>filename: OK</div><div><=
br></div><div>Even more, archive manages and other tools may try to parse t=
he test command output and the change may have some impact.</div><div><br><=
/div><div><div>&gt; this provides a way to view the stored file&#39;s size =
when it&#39;s larger than 4GiB.</div></div><div>I didn&#39;t get it. Can yo=
u please elaborate on this: `gzip --list` can&#39;t show uncompressed size =
more than 4GiB?</div><div><br></div><div dir=3D"ltr" class=3D"gmail_signatu=
re"><div dir=3D"ltr"><div>Regards, Sergey</div></div></div></div></div></di=
v>

--0000000000006476330579d63637--




Information forwarded to bug-gzip@HIDDEN:
bug#32903; Package gzip. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Oct 2018 06:50:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 02 02:50:06 2018
Received: from localhost ([127.0.0.1]:33699 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1g7EVR-0006w9-Vi
	for submit <at> debbugs.gnu.org; Tue, 02 Oct 2018 02:50:06 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38247)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <steve@HIDDEN>) id 1g7EVQ-0006vW-At
 for submit <at> debbugs.gnu.org; Tue, 02 Oct 2018 02:50:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <steve@HIDDEN>) id 1g7EVK-0008Ty-AD
 for submit <at> debbugs.gnu.org; Tue, 02 Oct 2018 02:49:58 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:55976)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <steve@HIDDEN>) id 1g7EVK-0008To-79
 for submit <at> debbugs.gnu.org; Tue, 02 Oct 2018 02:49:58 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47851)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <steve@HIDDEN>) id 1g7EVJ-0008G3-GH
 for bug-gzip@HIDDEN; Tue, 02 Oct 2018 02:49:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <steve@HIDDEN>) id 1g7EVG-0008S4-9a
 for bug-gzip@HIDDEN; Tue, 02 Oct 2018 02:49:57 -0400
Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]:42338)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <steve@HIDDEN>) id 1g7EVG-0008Oq-3S
 for bug-gzip@HIDDEN; Tue, 02 Oct 2018 02:49:54 -0400
Received: from heffalump.sk2.org (unknown [88.186.243.14])
 by smtp5-g21.free.fr (Postfix) with ESMTPS id C00515FFA0
 for <bug-gzip@HIDDEN>; Tue,  2 Oct 2018 08:49:45 +0200 (CEST)
Received: from steve by heffalump.sk2.org with local (Exim 4.89)
 (envelope-from <steve@HIDDEN>)
 id 1g7EV6-0000rQ-S7; Tue, 02 Oct 2018 08:49:45 +0200
From: Stephen Kitt <steve@HIDDEN>
To: bug-gzip@HIDDEN
Subject: [PATCH] Display uncompressed size when testing
Date: Tue,  2 Oct 2018 08:49:29 +0200
Message-Id: <20181002064929.3257-1-steve@HIDDEN>
X-Mailer: git-send-email 2.11.0
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
Cc: Stephen Kitt <steve@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

Alongside the OK message, print the real size in bytes; this provides
a way to view the stored file's size when it's larger than 4GiB.

Signed-off-by: Stephen Kitt <steve@HIDDEN>
---
 gzip.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gzip.c b/gzip.c
index e6a7761..4104472 100644
--- a/gzip.c
+++ b/gzip.c
@@ -62,6 +62,7 @@ static char const *const license_msg[] = {
 #include <stddef.h>
 #include <sys/stat.h>
 #include <errno.h>
+#include <inttypes.h>
 
 #include "tailor.h"
 #include "gzip.h"
@@ -807,7 +808,7 @@ local void treat_stdin()
 
     if (verbose) {
         if (test) {
-            fprintf(stderr, " OK\n");
+            fprintf(stderr, " OK (%jd bytes)\n", (intmax_t) bytes_out);
 
         } else if (!decompress) {
             display_ratio(bytes_in-(bytes_out-header_bytes), bytes_in, stderr);
@@ -1060,7 +1061,7 @@ local void treat_file(iname)
     /* Display statistics */
     if(verbose) {
         if (test) {
-            fprintf(stderr, " OK");
+            fprintf(stderr, " OK (%jd bytes)", (int_max_t) bytes_out);
         } else if (decompress) {
             display_ratio(bytes_out-(bytes_in-header_bytes), bytes_out,stderr);
         } else {
-- 
2.11.0





Acknowledgement sent to Stephen Kitt <steve@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gzip@HIDDEN. Full text available.
Report forwarded to bug-gzip@HIDDEN:
bug#32903; Package gzip. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.