mirror of
https://github.com/facebook/zstd.git
synced 2025-07-29 11:21:22 +03:00
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:
@ -24,6 +24,10 @@ zstd -c file | zstd -t
|
||||
zstd --stdout file | zstd -t
|
||||
println bob | zstd | zstd -t
|
||||
|
||||
# Test keeping input file when compressing to stdout in gzip mode
|
||||
$ZSTD_SYMLINK_DIR/gzip -c file | zstd -t ; test -f file
|
||||
$ZSTD_SYMLINK_DIR/gzip --stdout file | zstd -t ; test -f file
|
||||
|
||||
# Test --rm
|
||||
cp file file-rm
|
||||
zstd --rm file-rm; zstd -t file-rm.zst
|
||||
|
Reference in New Issue
Block a user