From 80388cee4bffe63edfd92b673a7e489132176bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Provazn=C3=ADk?= Date: Mon, 8 Sep 2025 14:44:45 +0200 Subject: [PATCH] Enhance GetTempPath documentation for MacOS and Linux Added MacOS specific behavior for GetTempPath method and clarified Linux permissions. --- xml/System.IO/Path.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xml/System.IO/Path.xml b/xml/System.IO/Path.xml index 81666951ded..417cfc0e104 100644 --- a/xml/System.IO/Path.xml +++ b/xml/System.IO/Path.xml @@ -2175,12 +2175,19 @@ If the current Windows version exposes the [`GetTempPath2`](https://learn.micros 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. +# [MacOS](#tab/macos) + +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. + +Otherwise, this method returns `/tmp/`. + # [Linux](#tab/linux) If the `TMPDIR` environment variable has been set, this method returns the value specified by that environment variable. Otherwise, this method returns `/tmp/`. - +The `/tmp/` directory on Linux is commonly shared among all users (`1777` permissions); ensure this meets your application's security needs. + --- ## Examples