1
Fork 0

Rollup merge of #137321 - aviraxp:patch-1, r=cuviper

Correct doc about `temp_dir()` behavior on Android

Since commit d5ccb038f6, `TMPDIR` will be set to application's cache dir when app starts.
This commit is contained in:
Michael Goulet 2025-02-24 19:21:46 -05:00 committed by GitHub
commit 1cd083d73f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -668,7 +668,9 @@ pub fn home_dir() -> Option<PathBuf> {
/// On Unix, returns the value of the `TMPDIR` environment variable if it is
/// set, otherwise the value is OS-specific:
/// - On Android, there is no global temporary folder (it is usually allocated
/// per-app), it returns `/data/local/tmp`.
/// per-app), it will return the application's cache dir if the program runs
/// in application's namespace and system version is Android 13 (or above), or
/// `/data/local/tmp` otherwise.
/// - On Darwin-based OSes (macOS, iOS, etc) it returns the directory provided
/// by `confstr(_CS_DARWIN_USER_TEMP_DIR, ...)`, as recommended by [Apple's
/// security guidelines][appledoc].