You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under OSX and Linux symlinks to directories are reported as symlinks to files. See the following test.nim:
import os
const target ="target_dir"proctest() =discardexecShellCmd("mkdir -p source_dir")
ifnot target.existsDir:
discardexecShellCmd("ln -s source_dir "& target)
for kind, path inwalkDir("."):
echo kind, " with path '", path, "'"whenisMainModule: test()
Compiling and running generates:
$ nim c -r test.nim
…
pcDir with path './nimcache'
pcDir with path './source_dir'
pcLinkToFile with path './target_dir'
pcFile with path './test'
pcFile with path './test.nim'
I was expecting to get a pcLinkToDir instead.
The text was updated successfully, but these errors were encountered:
I don't have a linux system at the moment to test this on, but I suspect this might be due to S_ISDIR not returning true for symlinks to directories.
As a side note, the directory walking procedures should be replaced with something more efficient and flexible - the current ones have unnecessary limitations.
Under OSX and Linux symlinks to directories are reported as symlinks to files. See the following
test.nim
:Compiling and running generates:
I was expecting to get a
pcLinkToDir
instead.The text was updated successfully, but these errors were encountered: