diff options
-rw-r--r-- | lib/pure/oswalkdir.nim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/pure/oswalkdir.nim b/lib/pure/oswalkdir.nim new file mode 100644 index 000000000..a27b12a78 --- /dev/null +++ b/lib/pure/oswalkdir.nim @@ -0,0 +1,16 @@ + +type + PathComponent* = enum ## Enumeration specifying a path component. + pcFile, ## path refers to a file + pcLinkToFile, ## path refers to a symbolic link to a file + pcDir, ## path refers to a directory + pcLinkToDir ## path refers to a symbolic link to a directory + +proc staticWalkDir(dir: string; relative: bool): seq[ + tuple[kind: PathComponent, path: string]] = + discard + +iterator walkDir*(dir: string; relative=false): tuple[kind: PathComponent, path: string] {. + tags: [ReadDirEffect], compiletime.} = + for k, v in staticWalkDir(dir, relative)): + yield (k, v) |