Skip to content

Commit

Permalink
doc(tempfiles): update link of getTempDir (#24661)
Browse files Browse the repository at this point in the history
- tempfiles: update `getTempDir` link... from os.html to appdirs.html
<https://nim-lang.org/docs/appdirs.html#getTempDir>

- ~~nims.md: rm three `std/`, which are out of place~~ (ref
#24661 (comment))
  • Loading branch information
litlighilit authored Feb 3, 2025
1 parent 0861dab commit e2bed72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/std/tempfiles.nim
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ proc genTempPath*(prefix, suffix: string, dir = ""): string =
##
## The path begins with `prefix` and ends with `suffix`.
##
## .. note:: `dir` must exist (empty `dir` will resolve to `getTempDir <os.html#getTempDir>`_).
## .. note:: `dir` must exist (empty `dir` will resolve to `getTempDir <appdirs.html#getTempDir>`_).
let dir = getTempDirImpl(dir)
result = dir / (prefix & randomPathName(nimTempPathLength) & suffix)

Expand All @@ -143,7 +143,7 @@ proc createTempFile*(prefix, suffix: string, dir = ""): tuple[cfile: File, path:
##
## .. note:: It is the caller's responsibility to close `result.cfile` and
## remove `result.file` when no longer needed.
## .. note:: `dir` must exist (empty `dir` will resolve to `getTempDir <os.html#getTempDir>`_).
## .. note:: `dir` must exist (empty `dir` will resolve to `getTempDir <appdirs.html#getTempDir>`_).
runnableExamples:
import std/os
doAssertRaises(OSError): discard createTempFile("", "", "nonexistent")
Expand Down Expand Up @@ -176,7 +176,7 @@ proc createTempDir*(prefix, suffix: string, dir = ""): string =
## If failing to create a temporary directory, `OSError` will be raised.
##
## .. note:: It is the caller's responsibility to remove the directory when no longer needed.
## .. note:: `dir` must exist (empty `dir` will resolve to `getTempDir <os.html#getTempDir>`_).
## .. note:: `dir` must exist (empty `dir` will resolve to `getTempDir <appdirs.html#getTempDir>`_).
runnableExamples:
import std/os
doAssertRaises(OSError): discard createTempDir("", "", "nonexistent")
Expand Down

0 comments on commit e2bed72

Please sign in to comment.