Skip to content

Commit

Permalink
[Minor] improve the docs of getTempDir (nim-lang#17058)
Browse files Browse the repository at this point in the history
* [Minor] improve the docs of getTempDir

* more clear

* Update lib/pure/os.nim

Co-authored-by: Andreas Rumpf <[email protected]>
  • Loading branch information
2 people authored and ardek66 committed Mar 26, 2021
1 parent d35ccf9 commit 105d0fd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/pure/os.nim
Original file line number Diff line number Diff line change
Expand Up @@ -954,13 +954,15 @@ proc getTempDir*(): string {.rtl, extern: "nos$1",
tags: [ReadEnvEffect, ReadIOEffect].} =
## Returns the temporary directory of the current user for applications to
## save temporary files in.
##
## On Windows, it calls [GetTempPath](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppathw)
## On Posix based platforms, it will check `TMPDIR`, `TEMP`, `TMP` and `TEMPDIR` environment variables.
##
## On Windows, it calls [GetTempPath](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppathw).
## On Posix based platforms, it will check `TMPDIR`, `TEMP`, `TMP` and `TEMPDIR` environment variables in order.
## On all platforms, `/tmp` will be returned if the procs fails.
##
## You can override this implementation
## by adding `-d:tempDir=mytempname` to your compiler invocation.
##
## **Note:** This proc does not check whether the returned path exists.
##
## See also:
## * `getHomeDir proc <#getHomeDir>`_
Expand Down

0 comments on commit 105d0fd

Please sign in to comment.