4

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.

Protocol
  • 98
  • 1
  • 8

1 Answers1

14

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.

TheLittleNaruto
  • 8,325
  • 4
  • 54
  • 73
Mark Adler
  • 101,978
  • 13
  • 118
  • 158
  • 1
    Thank you Mark. You answer is great! Sorry my reputation is not high enough to mark this answer is helpful. Really appreciate your answer. – Protocol Nov 16 '16 at 15:40