Skip to main content

tmpfile

Function tmpfile 

Source
pub fn tmpfile() -> file
Expand description

Returns a handle for a temporary file.

§Return value

A handle for a temporary file, opened in update mode and automatically removed when the program ends.

§Examples

local scratch = io.tmpfile()
scratch:write("intermediate data")
scratch:seek("set")
print(scratch:read("a"))    --> intermediate data

§See also

os::tmpname