1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use File;
use env;
use Path;
use io;
use imp;
/// Create an unnamed temporary file.
///
/// This method is secure/reliable in the presence of a pathological temporary file cleaner.
///
/// # Deletion:
///
/// ## Linux >= 3.11**
///
/// The temporary file is never linked into the filesystem so it can't be leaked.
///
/// ## Other *nix
///
/// The temporary file is immediately unlinked on create. The OS will delete it
/// when the last open copy of it is closed.
///
/// ## Windows
///
/// The temporary file is marked `DeleteOnClose` and, again, will be deleted
/// when the last open copy of it is closed. Unlike *nix operating systems, the
/// file is not immediately unlinked from the filesystem.
/// Create an unnamed temporary file in the specified directory.
///
/// See `tempfile()` for more information.