[src]

Function std::os::tmpdir

pub fn tmpdir() -> Path

Returns the path to a temporary directory.

On Unix, returns the value of the 'TMPDIR' environment variable if it is set and non-empty and '/tmp' otherwise. On Android, there is no global temporary folder (it is usually allocated per-app), hence returns '/data/tmp' which is commonly used.

On Windows, returns the value of, in order, the 'TMP', 'TEMP', 'USERPROFILE' environment variable if any are set and not the empty string. Otherwise, tmpdir returns the path to the Windows directory.