diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-03-19 02:23:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-19 10:23:05 +0100 |
commit | a17e87b516a075a04e3d27c55b9314090abf5bae (patch) | |
tree | f3bf8ab5ea7fc3ddfe3f50c0e31d00b3ef535446 /lib/pure | |
parent | ba6e7c636574b5c7add118daa7df6e4331f23fe1 (diff) | |
download | Nim-a17e87b516a075a04e3d27c55b9314090abf5bae.tar.gz |
fix #11458 oswalkdir (#13689)
* fix #11458 oswalkdir * changelog
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/oswalkdir.nim | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/lib/pure/oswalkdir.nim b/lib/pure/oswalkdir.nim index 1cf561c22..7d80b312c 100644 --- a/lib/pure/oswalkdir.nim +++ b/lib/pure/oswalkdir.nim @@ -7,30 +7,7 @@ # distribution, for details about the copyright. # -## Compile-time only version for walkDir if you need it at compile-time -## for JavaScript. - -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] = - for k, v in items(staticWalkDir(dir, relative)): - yield (k, v) - -iterator walkDirRec*(dir: string; filter = {pcFile, pcDir}): string = - var stack = @[dir] - while stack.len > 0: - for k, p in walkDir(stack.pop()): - if k in filter: - case k - of pcFile, pcLinkToFile: yield p - of pcDir, pcLinkToDir: stack.add(p) +## This module is deprecated, ``import os`` instead. +{.deprecated: "import os.nim instead".} +import os +export PathComponent, walkDir, walkDirRec |