staticos.nim 704 B

1234567891011121314151617
  1. ## This module implements path handling like os module but works at only compile-time.
  2. ## This module works even when cross compiling to OS that is not supported by os module.
  3. when defined(nimPreviewSlimSystem):
  4. import std/assertions
  5. proc staticFileExists*(filename: string): bool {.compileTime.} =
  6. ## Returns true if `filename` exists and is a regular file or symlink.
  7. ##
  8. ## Directories, device files, named pipes and sockets return false.
  9. raiseAssert "implemented in the vmops"
  10. proc staticDirExists*(dir: string): bool {.compileTime.} =
  11. ## Returns true if the directory `dir` exists. If `dir` is a file, false
  12. ## is returned. Follows symlinks.
  13. raiseAssert "implemented in the vmops"