Atom

fs.temporary_file()

Creates an empty unique temporary file and closes its initial descriptor.

Signature

fs.temporary_file([template])

Parameters

Optional text template ending in XXXXXX. Default uses the platform temporary directory.

Returns

Path string.

Behavior

The file remains on disk for later use.

Errors

Invalid template or OS failure.

Example

Atom
use fs
p = fs.temporary_file()
assert(fs.exists(p))
fs.remove(p)