GNU bug report logs - #37336
Allow to decompress files without .gz suffix and add an option to specify output file name on decompression

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; Severity: wishlist; Reported by: Sergey Ponomarev <stokito@HIDDEN>; dated Sat, 7 Sep 2019 21:13:02 UTC; Maintainer for gzip is bug-gzip@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 7 Sep 2019 21:12:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 07 17:12:23 2019
Received: from localhost ([127.0.0.1]:38147 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i6i0M-0001FU-Rd
	for submit <at> debbugs.gnu.org; Sat, 07 Sep 2019 17:12:23 -0400
Received: from lists.gnu.org ([209.51.188.17]:43166)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stokito@HIDDEN>) id 1i6i0K-0001FI-OV
 for submit <at> debbugs.gnu.org; Sat, 07 Sep 2019 17:12:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43897)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <stokito@HIDDEN>) id 1i6i0J-0000bZ-AJ
 for bug-gzip@HIDDEN; Sat, 07 Sep 2019 17:12:20 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 HTML_MESSAGE,SPOOFED_FREEMAIL autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <stokito@HIDDEN>) id 1i6i0I-0007PI-2f
 for bug-gzip@HIDDEN; Sat, 07 Sep 2019 17:12:19 -0400
Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]:42834)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <stokito@HIDDEN>) id 1i6i0H-0007Ox-RV
 for bug-gzip@HIDDEN; Sat, 07 Sep 2019 17:12:18 -0400
Received: by mail-io1-xd2b.google.com with SMTP id n197so20543371iod.9
 for <bug-gzip@HIDDEN>; Sat, 07 Sep 2019 14:12:17 -0700 (PDT)
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=JGjsg0Z8IripXKxJqJNo1wMzhPYka5eeSQt644hJHPw=;
 b=dKXPW1ZRLTSqHdNuwpqUZf1W0mXt4N5cBQLVIRaOovrmo0e/PbA+onHYgwAqAfnRnv
 ta3KwHA8IRl+P3Y2Yet0NLAjoriQYbsK8K5Ng7PO14tTEzFgad7GXmhM9eP19NIHMD9R
 uztsONKs/qaANikWE+uA/SvzyMpwq5QqRZ7pTTCo1QQ6EEy2oY3J2bdYdwDBBw5TK0cf
 bFh18tZD+jGxW7PkoeqV5w1IXxKLknk+5WD3UDuVqdViYH0tlT1bG3xtuCMQ0ttuXqsO
 rmtlLgRByf/HwuzjPg6R6w78cMGWERwf0rL8I99ewfxj8EGXpkwxC2RkEBq3Pbif2jya
 n1+A==
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=JGjsg0Z8IripXKxJqJNo1wMzhPYka5eeSQt644hJHPw=;
 b=AXibzj7RB50Pj1Rq4H559qT1eXsf3CluiohK/G8iQpDjNExxVm1XXBDfdtqT5jHwMk
 sSYnh81Y/HLCxAhDIHULbarYBIfeYvT2wj+hPATZ+lm1xLuh90qulv9m9n9BYIbbHFtb
 0NhxpYRf6ZGbRJFvYq9YcDs39xFDXHhIZnVqz+lSDTETPOT4YAc51q7c27PE3qCGNu/O
 Ju1VKEue8Rox+McO7cEQ0ilt4zjaE2rV/WGn9/DJBjA5ENSZerkJZ9va4K9MVK4rVP8c
 m7hhjnmTjYBlij5NAgiguaMr3B+yZGT3mAazCDMxjcUg5hi82qNtTECOxXNlT0NEi9Ep
 oEqg==
X-Gm-Message-State: APjAAAX3pLhUdKjRbExSMQbyu9SBgS4LatlLS9kgquR6/3EYAOueTWa0
 +ZyWkwsOm2brNiblxrO0MgVPaGYlLdyDYRERhkDAxAXd3x0=
X-Google-Smtp-Source: APXvYqzKHG5If5NX2u4S/p8U9ZP9czOtYuGU8ObWFCkzmplEFythzEHYzUr/jRU2x/bv1AVi72g5WfEXPp1Mi9lUYbU=
X-Received: by 2002:a02:a615:: with SMTP id c21mr17734231jam.117.1567890736407; 
 Sat, 07 Sep 2019 14:12:16 -0700 (PDT)
MIME-Version: 1.0
From: Sergey Ponomarev <stokito@HIDDEN>
Date: Sun, 8 Sep 2019 00:11:40 +0300
Message-ID: <CADR0UcXxApdrRTf2oGxAXRJCn27oOp61W_jraWQCP2-hasdQxQ@HIDDEN>
Subject: Allow to decompress files without .gz suffix and add an option to
 specify output file name on decompression
To: bug-gzip@HIDDEN
Content-Type: multipart/alternative; boundary="00000000000063e87e0591fd02fb"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::d2b
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
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: -2.3 (--)

--00000000000063e87e0591fd02fb
Content-Type: text/plain; charset="UTF-8"

Hello,

I have an SVG image file called image.svg. Then I gzipped and renamed it to
image.svgz.
The resulted *.svgz file is supported by almost all browsers as a usual
image.
But now I would like to extract the original file back:

$ gzip -d image.svgz
gzip: image.svgz: unknown suffix -- ignored

So gzip doesn't allow me to this just because the file have not a proper
.gz extension.
This makes sense because gzip can't determine the output file name. But
gzip by default stores an original file name (-N or -name option) so let's
add -N:

$ gzip -l -N idea.svgz
    compressed  uncompressed     ratio uncompressed_name
                 849                  2489  67.0% image.svg
$ gzip -d -N image.svgz
gzip: image.svgz: unknown suffix -- ignored

Again the same problem while I clearly specified to use an original file
name.
I confused and from my point of view this is a bug.

But if you try to decompress to stdout (i.e. use it with pipe and output to
a file) then all will be find.

The similar problem have another compressors like a new one ZStandard:
  https://github.com/facebook/zstd/issues/754

But in zstd there is an option to clearly specify the output file name:
-o file: result stored into `file` (only if 1 input file)

This also solves the problem but also makes it more convinced to call
pragmatically gzip without pipes (i.e. to call it from an archive manager
like GNOME File Roller)

So, could you consider to implement the feature or will you accept a patch
from me?

Regards,
Sergey Ponomarev

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

<div dir=3D"ltr"><div>Hello,</div><div><br></div><div>I have an SVG image f=
ile called image.svg. Then I gzipped and renamed it to image.svgz.</div><di=
v>The resulted *.svgz file is supported by almost all browsers as a usual i=
mage.</div><div>But now I would like to extract the original file back:</di=
v><div><br></div><div>$ gzip -d image.svgz<br>gzip: image.svgz: unknown suf=
fix -- ignored<br></div><div><br></div><div>So gzip doesn&#39;t allow me to=
 this just because the file have not a proper .gz extension.</div><div>This=
 makes sense because gzip can&#39;t determine the output file name. But gzi=
p by default stores an original file name (-N or -name option) so let&#39;s=
 add -N:</div><div><br></div><div>$ gzip -l -N idea.svgz<br>=C2=A0 =C2=A0 c=
ompressed=C2=A0 uncompressed=C2=A0 =C2=A0 =C2=A0ratio uncompressed_name<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0849=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2489 =C2=A067.0% image=
.svg<br></div><div><div>$ gzip -d -N image.svgz<br>gzip: image.svgz: unknow=
n suffix -- ignored<br></div><div></div></div><div><br></div><div>Again the=
 same problem while I clearly specified to use an original file name.</div>=
<div>I confused and from my point of view this is a bug.</div><div><br></di=
v><div>But if you try to decompress to stdout (i.e. use it with pipe and ou=
tput to a file) then all will be find.</div><div><br></div><div>The similar=
 problem have another compressors like a new one ZStandard:</div><div>=C2=
=A0=C2=A0<a href=3D"https://github.com/facebook/zstd/issues/754">https://gi=
thub.com/facebook/zstd/issues/754</a><br></div><div><br></div><div>But in z=
std there is an option to clearly specify the output file name:</div><div>-=
o file: result stored into `file` (only if 1 input file)<br></div><div><br>=
</div><div>This also solves the problem but also makes it more convinced to=
 call pragmatically gzip without pipes (i.e. to call it from an archive man=
ager like GNOME File Roller)</div><div><br></div><div>So, could you conside=
r to implement the feature or will you accept a patch from me?</div><div><b=
r></div>Regards,<br><div dir=3D"ltr" class=3D"gmail_signature" data-smartma=
il=3D"gmail_signature"><div dir=3D"ltr"><div>Sergey=C2=A0Ponomarev<br></div=
></div></div></div>

--00000000000063e87e0591fd02fb--




Acknowledgement sent to Sergey Ponomarev <stokito@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gzip@HIDDEN. Full text available.
Report forwarded to bug-gzip@HIDDEN:
bug#37336; 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: Wed, 30 Mar 2022 00:00:02 UTC

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