Skip to content

An Elixir library for creating tar archives in-memory

Notifications You must be signed in to change notification settings

akasprzok/memo_tar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

An Elixir library for creating tar archives in-memory

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages