Tmp v0.1.0 Tmp View Source

Temporary directories that are monitored and automatically removed.

Link to this section Summary

Functions

Creates a temporary directory and passes the path to the given function.

Link to this section Functions

Link to this function

dir(function, options \\ [])

View Source

Specs

dir(function(), list()) :: term()

Creates a temporary directory and passes the path to the given function.

The function runs in a new linked GenServer process. The directory is automatically removed when the function returns or the process terminates.

Examples

iex> Tmp.dir(fn _tmp_dir_path -> 1 + 1 end)
2