file_temp
host callCapy
function file_temp(prefix : string) string
Description
file_temp creates an empty file with a unique suffix.
Parameters
prefix : path prefix for the temporary file
Return Values
The new empty file path. Returns "" on failure.
Example
Capy
var path := file_temp("/tmp/doc-temp-")
if path != "" {
file_put_contents(path, "scratch")
print(file_get_contents(path), "\n")
file_unlink(path)
}