Protocol
Protocol

Reputation: 98

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.

Upvotes: 4

Views: 5307

Answers (1)

Mark Adler
Mark Adler

Reputation: 112452

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.

Upvotes: 14

Related Questions