mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
brotli CLI: how to stop continuous compression and write valid file? #531
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @derhuerst on GitHub (Dec 3, 2024).
I'm trying to compress a the data from continuous stream of logs for a certain period of time. At some point, I want the
brotliCLI to stop compressing and write a clean/valid brotli-compressed file.This also doesn't work with
SIGQUIT,SIGTERMandSIGHUP.@eustas commented on GitHub (May 27, 2025):
brotliwaits for end-of-stream (Ctrl-D).We currently do not set interruption handlers in CLI. You could turn this issue to feature-request if there is no workaround to emulate end-of-stream.
@derhuerst commented on GitHub (Oct 23, 2025):
Actually, I found one: AFAICT, if you run a pipeline, typing Ctrl+C will send
SIGINTto all of its processes. A workaround would be to "shield" thebrotliprocess from the SIGINT, letting it work until it hits EOF.As documented in a StackOverflow answer, this can be achieved with a subshell and
trap '' INT:However, I'd argue that
What do you think, does this warrant a feature request?