summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-02-25 06:58:31 -0600
committerGitHub <noreply@github.com>2021-02-25 13:58:31 +0100
commitf07bdbe945ff3d459e42ce10e253bb427126a1b9 (patch)
tree25318c28149dfa46b41302aab11275805aafec2b
parentdcd3f26876a73877fb8a087e0342198bdabb6b77 (diff)
downloadNim-f07bdbe945ff3d459e42ce10e253bb427126a1b9.tar.gz
clarify the docs of existsOrCreateDir a bit (#17182)
* remove unnecessary when statement

* remove outdated codes

* clarify the docs a bit
-rw-r--r--lib/pure/os.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index 66a803058..42e3994c1 100644
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -2436,11 +2436,10 @@ proc rawCreateDir(dir: string): bool {.noWeirdTarget.} =
 
 proc existsOrCreateDir*(dir: string): bool {.rtl, extern: "nos$1",
   tags: [WriteDirEffect, ReadDirEffect], noWeirdTarget.} =
-  ## Check if a `directory`:idx: `dir` exists, and create it otherwise.
+  ## Checks if a `directory`:idx: `dir` exists, and creates it otherwise.
   ##
-  ## Does not create parent directories (fails if parent does not exist).
-  ## Returns `true` if the directory already exists, and `false`
-  ## otherwise.
+  ## Does not create parent directories (raises `OSError` if parent directories do not exist).
+  ## Returns `true` if the directory already exists, and `false` otherwise.
   ##
   ## See also:
   ## * `removeDir proc <#removeDir,string>`_