Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compress a folder with brotli command line (version 0.5.2)?

I am trying to compress a folder with Brotli(0.5.2) command line on Ubuntu 15.10

~/brotli-0.5.2$ ./bro -f -i ./dec/ -o folder.br

Then get error message:

failed to read input

Does anyone know how to compress folder with brotli?

Thanks.

like image 820
Protocol Avatar asked Dec 11 '22 14:12

Protocol


1 Answers

brotli can only compress a file or a single stream of data. Just like gzip, xz, lzip, etc. To compress a directory, you would do what all archivers do, which is to convert the information in the directory into a single stream of data and write that to a file.

You did not provide a clue to your operating system in the question or tags, but on Unix-like systems, tar is used to take a directory and all of its contents in files, subdirectories, symbolic links, etc., and convert those to a single stream of data. Then you can use bro on that, as you would use any other compressor gzip, xz, etc. on it.

like image 103
Mark Adler Avatar answered Feb 23 '23 15:02

Mark Adler