mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-24 08:15:25 +00:00
Add staticFileExists and staticDirExists (#22278)
This commit is contained in:
13
lib/std/staticos.nim
Normal file
13
lib/std/staticos.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
## This module implements path handling like os module but works at only compile-time.
|
||||
## This module works even when cross compiling to OS that is not supported by os module.
|
||||
|
||||
proc staticFileExists*(filename: string): bool {.compileTime.} =
|
||||
## Returns true if `filename` exists and is a regular file or symlink.
|
||||
##
|
||||
## Directories, device files, named pipes and sockets return false.
|
||||
discard
|
||||
|
||||
proc staticDirExists*(dir: string): bool {.compileTime.} =
|
||||
## Returns true if the directory `dir` exists. If `dir` is a file, false
|
||||
## is returned. Follows symlinks.
|
||||
discard
|
||||
Reference in New Issue
Block a user