View Source divingbells

build codecov Release License Documentation

divingbells is a escript for compressing and decompressing single file, files (WIP), and directories (WIP) by using huffman coding or huffman coding-like algorithm.

Installation

Rebar3

divingbells is built using rebar3, if this library is used with rebar3 simply put it in your rebar.config file:

{deps, [
    divingbells
    ]}.

Other

If you don't use rebar3 it's possibly to get the latest version from gitlab

Build

$ rebar3 compile
$ rebar3 escriptize

The escript is generated at <project-root>/_build/default/bin/divingbells. Copy the executable divingbells and put it in your PATH in order to use it.

Test

To run the tests call eunit via rebar3

$ rebar3 eunit

Usage

Configuration

The escript is primarly intended to be used through CLI. The following configurations can be used

 -C, --compress              compress FILE
 -D, --decompress            decompress FILE
 -f, --file                  FILE to compress or decomress
 -d, --destination-file      file to write the result to
 -h, --help                  print this help

Example

$ ls
divingbells  example.txt
$ ./divingbells -C -f example.txt
$ ls
divingbells example.txt example.txt.dbc
$ ./divingbells -D -f example.txt.dbc -d example.text
$ ls
divingbells example.text example.txt example.txt.dbc
$ cat example.text
hello world