dgvncsz0f / zipflow

stream a zip archive while building it
BSD 3-Clause "New" or "Revised" License
24 stars 5 forks source link

os.ex: a module to include a file/directory as a zip entry #3

Closed dgvncsz0f closed 8 years ago

dgvncsz0f commented 8 years ago

this includes a new module, OS.ex which provides file_entry and dir_entry. These functions are used to add a file and a directory respectively. Its use is very straightforward but following an example:

iex> devnull = fn _ -> () end
iex> Zipflow.Stream.init
... |> Zipflow.OS.file_entry(devnull, "/name/on/ziparchive", "/path/on/file")
... |> Zipflow.OS.dir_entry(devnull, "/path/to/dir")
... |> Zipflow.Stream.flush(devnull)

Please refer to os.ex for more information.