fixes #5519
This commit is contained in:
parent
4644484fb7
commit
68c6d709d3
2 changed files with 42 additions and 3 deletions
|
|
@ -103,3 +103,39 @@ proc unusedB =
|
|||
var count = 0
|
||||
for line in lineIter2("temp10.nim"):
|
||||
count += 1
|
||||
|
||||
# bug #5519
|
||||
import os, algorithm
|
||||
|
||||
iterator filesIt(path: string): auto {.closure.} =
|
||||
var files = newSeq[string]()
|
||||
var dirs = newSeq[string]()
|
||||
for k, p in os.walkDir(path):
|
||||
let (_, n, e) = p.splitFile
|
||||
if e != "":
|
||||
continue
|
||||
case k
|
||||
of pcFile, pcLinkToFile:
|
||||
files.add(n)
|
||||
else:
|
||||
dirs.add(n)
|
||||
files.sort(system.cmp)
|
||||
dirs.sort(system.cmp)
|
||||
for f in files:
|
||||
yield f
|
||||
|
||||
for d in dirs:
|
||||
files = newSeq[string]()
|
||||
for k, p in os.walkDir(path / d):
|
||||
let (_, n, e) = p.splitFile
|
||||
if e != "":
|
||||
continue
|
||||
case k
|
||||
of pcFile, pcLinkToFile:
|
||||
files.add(n)
|
||||
else:
|
||||
discard
|
||||
files.sort(system.cmp)
|
||||
let prefix = path.splitPath[1]
|
||||
for f in files:
|
||||
yield prefix / f
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue