Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brotli CLI: how to stop continuous compression and write valid file? #1227

Open
derhuerst opened this issue Dec 3, 2024 · 0 comments
Open

Comments

@derhuerst
Copy link

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 brotli CLI to stop compressing and write a clean/valid brotli-compressed file.

bash -c 'while true; do echo "some log line"; sleep 1; done' | brotli >logs.txt.br
# After some time, I send SIGINT via ctrl + c.
# ^C

# Once the `brotli` process has exited, I would expect to be able to read the compressed file. However, this is not possible:
brotli -d foo.txt.br | wc -l
# corrupt input [foo.txt.br]
#        0

This also doesn't work with SIGQUIT, SIGTERM and SIGHUP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant