nim-iterutils
nim-iterutils copied to clipboard
Concat and walkDir don't work together.
Concat works for other iterators like in your tests, but does not work with walkDir, I don't understand why:
import os, iterutils
# works
for n in concat(toIter(1..4), toIter(20..23)):
echo n
# does not work
for f in concat(walkDir("."), walkDir(".")):
echo f
I don't understand the error either:
C:\p\try\iterwalkdir.nim(6, 31) Error: attempting to call routine: 'walkDir'
found 'os.walkDir(dir: string, relative: bool, checkDir: bool) [declared in C:\Users\me\.choosenim\toolchains\nim-1.4.6\lib\pure\os.nim(2076, 10)]' of kind 'iterator
Maybe you can help?
Looks like walkDir changed its definition and you also need to pass the parameters relative & checkDir. Maybe like this:
for f in concat(walkDir(".", true, false), walkDir(".", true, false)):
echo f