Temp
SourceSummary
cleanup(timeout \\ :infinity) | Cleans up the temporary files tracked |
mkdir!(options \\ %{}) | Same as |
mkdir(options \\ %{}) | Returns |
open!(options \\ nil, func \\ nil) | Same as |
open(options \\ nil, func \\ nil) | Returns |
path!(options \\ nil) | Same as |
path(options \\ nil) | Returns a |
track!() | Same as |
track() | Returns |
tracked() | Return the paths currently tracked |
Types
Functions
Cleans up the temporary files tracked.
Specs:
Returns {:ok, dir_path}
where dir_path
is the path is the path of the
created temporary directory.
Returns {:error, reason}
if a failure occurs.
Specs:
Same as mkdir/1
, but raises an exception on failure. Otherwise, returns
a temporary directory path.
Specs:
- open(options, nil | (File.io_device -> any)) :: {:ok, File.io_device, Path.t} | {:error, any}
Returns {:ok, fd, file_path}
if no callback is passed, or {:ok, file_path}
if callback is passed, where fd
is the file descriptor of a temporary file
and file_path
is the path of the temporary file.
When no callback is passed, the file descriptor should be closed.
Returns {:error, reason}
if a failure occurs.
Specs:
- open!(options, pid | nil) :: {File.io_device, Path.t}
Same as open/1
, but raises an exception on failure.
Specs:
Returns a {:ok, path}
where path
is a path that can be used freely in the
system temporary directory, or {:error, reason}
if it fails to get the
system temporary directory.
Specs:
Same as path/1
, but raises an exception on failure. Otherwise, returns a temporary path.
Specs:
- track :: Agent.on_start
Returns :ok
when the tracking server used to track temporary files started properly.
Specs:
- track! :: pid
Same as track/1
, but raises an exception on failure. Otherwise, returns :ok
Specs:
- tracked :: Set.t
Return the paths currently tracked.