mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
doc(tempfiles): update link of getTempDir (#24661)
- 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 https://github.com/nim-lang/Nim/pull/24661#discussion_r1937293833)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user