Files
cppdraft_translate/cppdraft/fs/op/temp/dir/path.md
2025-10-25 03:02:53 +03:00

1.9 KiB

[fs.op.temp.dir.path]

31 Input/output library [input.output]

31.12 File systems [filesystems]

31.12.13 Filesystem operation functions [fs.op.funcs]

31.12.13.39 Temporary directory path [fs.op.temp.dir.path]

🔗

path filesystem::temp_directory_path(); path filesystem::temp_directory_path(error_code& ec);

1

#

Let p be an unspecified directory path suitable for temporary files.

2

#

Effects: If exists(p) is false or is_directory(p) is false, an error is reported ([fs.err.report]).

3

#

Returns: The path p.

The signature with argument ec returns path() if an error occurs.

4

#

Throws: As specified in [fs.err.report].

5

#

[Example 1:

For POSIX-based operating systems, an implementation might return the path supplied by the first environment variable found in the list TMPDIR, TMP, TEMP, TEMPDIR, or if none of these are found, "/tmp".

For Windows-based operating systems, an implementation might return the path reported by the Windows GetTempPath API function.

— end example]