GNU bug report logs - #50097
gzip: add "--keep" option to keep original files unchanged

Previous Next

Package: gzip;

Reported by: Krzysztof Żelechowski <giecrilj <at> stegny.2a.pl>

Date: Tue, 17 Aug 2021 17:45:01 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Krzysztof Żelechowski <giecrilj <at> stegny.2a.pl>
Cc: Rodrigo Campos <rodrigo <at> sdfg.com.ar>, 50097 <at> debbugs.gnu.org, Antonio Diaz Diaz <antonio <at> gnu.org>
Subject: bug#50097: gzip: add "--keep" option to keep original files unchanged
Date: Fri, 20 Aug 2021 08:15:43 -0700
On 8/20/21 7:52 AM, Krzysztof Żelechowski wrote:

>> echo hello >a
>> ln a b
>> gzip -k b && gzip -cd b.gz >>b
>>
>> This would trash 'a' if gzip -k succeeded. (Same with 'ln -s'.)
> 
> The appending redirection operator has nothing to do with gzip.

That's true even without -k: if plain 'gzip b' succeeded in this case, 
any problem that the user ran into later would have nothing to do with 
gzip. Plain 'gzip b' ignores 'b' here, not because compressing 'b' would 
cause any problem with gzip itself, but because it could cause confusion 
*later*.


> My normal usage of (hard) links is as follows:
> Create a file page.txt. Link it to page.html.
> Want to view? Open page.html.
> Want to edit? Open page.txt.
> Want to attach? gzip -k page.html … oops.

Oh my. That is ... unusual. Let's see if others chime in about whether 
this usage would justify changing the behavior of gzip -k.




This bug report was last modified 3 years and 78 days ago.

Previous Next


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