Skip to content

Commit f4d3ce3

Browse files
authored
Enhance GetTempPath documentation for MacOS and Linux (#11780)
Added MacOS specific behavior for GetTempPath method and clarified Linux permissions.
1 parent 0116ad5 commit f4d3ce3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

xml/System.IO/Path.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2175,12 +2175,19 @@ If the current Windows version exposes the [`GetTempPath2`](https://learn.micros
21752175
21762176
On Windows versions that don't expose GetTempPath2, this method instead invokes the [`GetTempPath`](https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-gettemppathw) Win32 API and returns the resolved path. For more information on how this resolution is performed, including how to control the return value through the use of environment variables, see [the _Remarks_ section](https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-gettemppathw#remarks) of the GetTempPath documentation.
21772177
2178+
# [MacOS](#tab/macos)
2179+
2180+
If the `TMPDIR` environment variable has been set, this method returns the value specified by that environment variable. MacOS sets `TMPDIR` on login to a per-user temporary directory.
2181+
2182+
Otherwise, this method returns `/tmp/`.
2183+
21782184
# [Linux](#tab/linux)
21792185
21802186
If the `TMPDIR` environment variable has been set, this method returns the value specified by that environment variable.
21812187
21822188
Otherwise, this method returns `/tmp/`.
2183-
2189+
The `/tmp/` directory on Linux is commonly shared among all users (`1777` permissions); ensure this meets your application's security needs.
2190+
21842191
---
21852192
21862193
## Examples

0 commit comments

Comments
 (0)