mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-05 03:14:08 +00:00
This commit is contained in:
@@ -8,7 +8,7 @@ from std/private/osdirs import dirExists, createDir, existsOrCreateDir, removeDi
|
||||
|
||||
export PathComponent
|
||||
|
||||
proc dirExists*(dir: Path): bool {.inline, tags: [ReadDirEffect].} =
|
||||
proc dirExists*(dir: Path): bool {.inline, tags: [ReadDirEffect], sideEffect.} =
|
||||
## Returns true if the directory `dir` exists. If `dir` is a file, false
|
||||
## is returned. Follows symlinks.
|
||||
result = dirExists(dir.string)
|
||||
|
||||
@@ -9,7 +9,7 @@ from std/private/osfiles import fileExists, removeFile,
|
||||
moveFile
|
||||
|
||||
|
||||
proc fileExists*(filename: Path): bool {.inline, tags: [ReadDirEffect].} =
|
||||
proc fileExists*(filename: Path): bool {.inline, tags: [ReadDirEffect], sideEffect.} =
|
||||
## Returns true if `filename` exists and is a regular file or symlink.
|
||||
##
|
||||
## Directories, device files, named pipes and sockets return false.
|
||||
|
||||
@@ -119,7 +119,7 @@ when not defined(windows):
|
||||
const maxSymlinkLen* = 1024
|
||||
|
||||
proc fileExists*(filename: string): bool {.rtl, extern: "nos$1",
|
||||
tags: [ReadDirEffect], noNimJs.} =
|
||||
tags: [ReadDirEffect], noNimJs, sideEffect.} =
|
||||
## Returns true if `filename` exists and is a regular file or symlink.
|
||||
##
|
||||
## Directories, device files, named pipes and sockets return false.
|
||||
@@ -137,7 +137,7 @@ proc fileExists*(filename: string): bool {.rtl, extern: "nos$1",
|
||||
|
||||
|
||||
proc dirExists*(dir: string): bool {.rtl, extern: "nos$1", tags: [ReadDirEffect],
|
||||
noNimJs.} =
|
||||
noNimJs, sideEffect.} =
|
||||
## Returns true if the directory `dir` exists. If `dir` is a file, false
|
||||
## is returned. Follows symlinks.
|
||||
##
|
||||
@@ -155,7 +155,7 @@ proc dirExists*(dir: string): bool {.rtl, extern: "nos$1", tags: [ReadDirEffect]
|
||||
|
||||
proc symlinkExists*(link: string): bool {.rtl, extern: "nos$1",
|
||||
tags: [ReadDirEffect],
|
||||
noWeirdTarget.} =
|
||||
noWeirdTarget, sideEffect.} =
|
||||
## Returns true if the symlink `link` exists. Will return true
|
||||
## regardless of whether the link points to a directory or file.
|
||||
##
|
||||
|
||||
@@ -6,7 +6,7 @@ from paths import Path, ReadDirEffect
|
||||
|
||||
from std/private/ossymlinks import symlinkExists, createSymlink, expandSymlink
|
||||
|
||||
proc symlinkExists*(link: Path): bool {.inline, tags: [ReadDirEffect].} =
|
||||
proc symlinkExists*(link: Path): bool {.inline, tags: [ReadDirEffect], sideEffect.} =
|
||||
## Returns true if the symlink `link` exists. Will return true
|
||||
## regardless of whether the link points to a directory or file.
|
||||
result = symlinkExists(link.string)
|
||||
|
||||
Reference in New Issue
Block a user