View Source z_tempfile (zotonic_stdlib v1.21.0)
Summary
Functions
Delete all tempfiles not modified in the last day.
Check if the file is a temporary filename.
Add a process to the tempfile monitor. The tempfile is deleted after all attached processes stopped or are detached.
Remove a process from the tempfile monitor. The tempfile is deleted after all attached processes stopped or are detached.
Like new/0 but also return the Pid of the monitoring process.
Like new/1 but also return the Pid of the monitoring process.
Return a new unique filename, start a monitoring process to clean it up after use. The file must be created and written within 10 seconds, or it will be deleted.
Return a new unique filename, start a monitoring process to clean it up after use. The file must be created and written within 10 seconds, or it will be deleted.
return a unique temporary filename located in the TMP directory.
return a unique temporary filename with the given extension.
Returns the path where to store temporary files.
Functions
-spec cleanup() -> ok.
-spec is_tempfile(file:filename_all()) -> boolean().
-spec monitored_attach(pid()) -> ok.
-spec monitored_detach(pid()) -> ok.
-spec monitored_new() -> {ok, {pid(), file:filename_all()}}.
-spec monitored_new(string() | binary()) -> {ok, {pid(), file:filename_all()}}.
-spec new() -> file:filename_all().
-spec new(string() | binary()) -> file:filename_all().
-spec tempfile() -> file:filename_all().
-spec tempfile(string() | binary()) -> file:filename_all().
-spec temppath() -> file:filename_all().