oscommons
nimony/lib/std/private/oscommons.nim
type PathComponent = enum pcFile = (0, "pcFile") pcLinkToFile = (1, "pcLinkToFile") pcDir = (2, "pcDir") pcLinkToDir = (3, "pcLinkToDir")
func dollar`.PathComponent(e: PathComponent): stringconst weirdTarget: boolconst supportedSystem: boolproc getSymlinkFileKind(path: string): tuple[pc: PathComponent, isSpecial: bool]proc tryMoveFSObject(source: string; dest: string; isDir: bool): boolMoves a file (or directory if
isDiris true) fromsourcetodest.Returns false in case of
EXDEVerror orAccessDeniedErroron Windows (ifisDiris true). In case of other errorsOSErroris raised. Returns true in case of success.const maxSymlinkLen: int64proc fileExists(filename: string): boolReturns true if
filenameexists and is a regular file or symlink.Directories, device files, named pipes and sockets return false.
See also:
dirExists proc_symlinkExists proc_
proc dirExists(dir: string): boolReturns true if the directory
direxists. Ifdiris a file, false is returned. Follows symlinks.See also:
fileExists proc_symlinkExists proc_
proc symlinkExists(link: string): boolReturns true if the symlink
linkexists. Will return true regardless of whether the link points to a directory or file.See also:
fileExists proc_dirExists proc_