From 7578d580e0167bcfbd77fe7fd1393cfa7a6f1ede Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 10 Nov 2015 15:35:02 +0100 Subject: [PATCH] added oswalkdir.nim for the JS target --- lib/pure/oswalkdir.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/pure/oswalkdir.nim diff --git a/lib/pure/oswalkdir.nim b/lib/pure/oswalkdir.nim new file mode 100644 index 0000000000..a27b12a78d --- /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)