added oswalkdir.nim for the JS target
This commit is contained in:
parent
2aff716134
commit
7578d580e0
1 changed files with 16 additions and 0 deletions
16
lib/pure/oswalkdir.nim
Normal file
16
lib/pure/oswalkdir.nim
Normal file
|
|
@ -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)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue