I have a simple directory containing just 2 links to other directories. os.walk does not walk into them, it reports 2 files and 0 directories. I note the docs refer to "symlink" which I suspect is a Unix term not MS but Im not sure. Or is there something else im missing?

[Python 2.7 on Vista Pro]

有帮助吗?

解决方案

It does not work on Windows (at least in Windows 7).

followlink depends on os.islink, os.isdir. But both returns False for Link directory in windows (in Python 2.7).

BTW, in Python 3.2+, os.islink return True for symlinks. But os.isdir still return False. os.walk does not work neither.

See os.path.islink on windows with python.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top