#998207 lz4: redirecting stdout to /dev/null changes program behaviour

Package:
lz4
Source:
lz4
Description:
Fast LZ compression algorithm library - tool
Submitter:
Witold Baryluk
Date:
2021-11-01 00:06:03 UTC
Severity:
important
#998207#5
Date:
2021-11-01 00:04:05 UTC
From:
To:
Running

lz4 --quiet --keep input.file.txt

will produce input.file.txt.lz4

lz4 --quiet --keep input.file.txt >/dev/null

will instead print this on stderr:

Warning : using stdout as default output. Do not rely on this behavior: use explicit `-c` instead !

and produces no compressed file.

This is behaviour different than all compression tools (gzip, bzip2,
lzma, xz, brotli, arj, 7z, zip, cab, snappy, zstd, ...).

Stdout should only be used when `-c` is expliclty passed, or the input is
the stdout (i.e. foo | lz4 | ...).

Regards,
Witold