Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add documentation about os.tmpdir() overrides #54613

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

joyeecheung
Copy link
Member

This documents the TMPDIR, TEMP and TMP overrides on different platforms and that some operating systems set these by default.

  1. It seems on Windows, TEMP and TMP tend to be configured by default on a fresh installation. I found an article listing the typical default values of TEMP and TMP in https://www.computerhope.com/issues/ch000088.htm which matches what I saw in the CI.
  2. On macOS TMPDIR seems to be configured by default as well. On my local environment I get a folder under /var/folders by default, and I found an article explaining this https://magnusviri.com/what-is-var-folders.html
  3. On Linux it seems to vary depending on your distribution. In a fresh Ubuntu server installation TMPDIR seems unconfigured, so os.tmpdir() tends to default to /tmp which matches my memory.

This documents the TMPDIR, TEMP and TMP overrides on different
platforms and that some operating systems set these by default.
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. os Issues and PRs related to the os subsystem. labels Aug 28, 2024
`TEMP` takes precedence over `TMP`. If neither is set, it defaults to `%SystemRoot%\temp`
or `%windir%\temp`.

On non-Windows platforms, `TMPDIR`, `TMP` and `TEMP` environment variables will be checked
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels strange to me that TMP and TEMP are checked in different order on Windows and non-Windows platforms. Maybe it would be better to make it consistent, but then that should be done in a different PR.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@joyeecheung joyeecheung added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 30, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 30, 2024
@nodejs-github-bot nodejs-github-bot merged commit 9bdf2ee into nodejs:main Aug 30, 2024
23 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 9bdf2ee

sendoru pushed a commit to sendoru/node that referenced this pull request Sep 1, 2024
This documents the TMPDIR, TEMP and TMP overrides on different
platforms and that some operating systems set these by default.

PR-URL: nodejs#54613
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request Sep 12, 2024
This documents the TMPDIR, TEMP and TMP overrides on different
platforms and that some operating systems set these by default.

PR-URL: #54613
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. os Issues and PRs related to the os subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants