Keep original file if -c or --stdout is given

Set removeSrcFile back to false when -c or --stdout is used to improve
compatibility with gzip(1) behavior.

gzip(1) is removing the original file on compression unless --stdout or
/-c is used. zstd is defaulting to keep the file unless --rm is used or
when it is called via a gzip symlink, in which it is removing by
default. Specifying -c/--stdout turns this behavior off.
This commit is contained in:
Dirk Müller
2022-03-09 23:38:59 +01:00
parent 8814aa5bfa
commit 3f4f8b04ed
4 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ the last one takes effect.
disable input and output checks. Allows overwriting existing files, input
from console, output to stdout, operating on links, block devices, etc.
* `-c`, `--stdout`:
write to standard output (even if it is the console)
write to standard output (even if it is the console); keep original files unchanged.
* `--[no-]sparse`:
enable / disable sparse FS support,
to make files with many zeroes smaller on disk.