Tempfile v0.1.0 Tempfile.File

The server responsible for generating random files with random prefixes and ensuring that those files are cleaned up when the calling process exits.

Summary

Functions

Requests a random file to be created in the tempfile directory based on the provided filename. Files are placed in the environment specified temporary directory, or in the local /tmp directory otherwise

Functions

random(filename)

Specs

random(String.t) ::
  {:ok, String.t} |
  {:too_many_attempts, String.t, pos_integer}

Requests a random file to be created in the tempfile directory based on the provided filename. Files are placed in the environment specified temporary directory, or in the local /tmp directory otherwise.

Example

iex> Tempfile.random("temporary.txt")
{:ok, "./tmp/temporary-12345-456789-3.txt"}
start_link()