You must have gotten truly lost to end up here. This is an Elixir library for creating tar archives in memory.
To create a tar archive in memory:
{:ok, binary} = MemoTar.create([{"foo.txt", "Hello World"}])
You can also add files one at a time. However, this also currently requires that directories are added manually:
{:ok, tar} = MemoTar.open()
:ok = MemoTar.add_directory(tar, "foo")
:ok = MemoTar.add_file(tar, "foo/bar.txt", "Hello World")
{:ok, binary} = MemoTar.close(tar)
If available in Hex, the package can be installed
by adding tar_open
to your list of dependencies in mix.exs
:
def deps do
[
{:memo_tar, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/tar_open.