Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 979 Bytes

README.md

File metadata and controls

40 lines (29 loc) · 979 Bytes

MemoTar

You must have gotten truly lost to end up here. This is an Elixir library for creating tar archives in memory.

Usage

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)

Installation

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.