Skip to content

Commit

Permalink
Correct doc about temp_dir() behavior on Android
Browse files Browse the repository at this point in the history
Since commit aosp-mirror/platform_frameworks_base@d5ccb03, `TMPDIR` will be set to application's cache dir when app starts.
  • Loading branch information
aviraxp authored Feb 20, 2025
1 parent 28b83ee commit 0d4d752
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down

0 comments on commit 0d4d752

Please sign in to comment.