exfile v0.3.6 Exfile.Tempfile View Source

A server (a GenServer specifically) that manages temporary files.

Temporary files are stored in a temporary directory and removed from that directory after the process that requested the file dies.

Link to this section Summary

Functions

Requests a random file to be created in the temporary directory with the given prefix

Requests a random file to be created in the temporary directory with the given prefix. Raises on failure

Starts the temporary file handling server

Link to this section Functions

Link to this function random_file(prefix) View Source
random_file(binary) ::
  {:ok, binary} |
  {:too_many_attempts, binary, pos_integer} |
  {:no_tmp, [binary]}

Requests a random file to be created in the temporary directory with the given prefix.

Link to this function random_file!(prefix) View Source
random_file!(binary) :: binary | no_return

Requests a random file to be created in the temporary directory with the given prefix. Raises on failure.

Link to this function register_file(path) View Source
register_file(binary) :: :ok

Starts the temporary file handling server.