In os
there's a function os.path.islink(PATH)
which checks if PATH
is symlink. But if fails when PATH is a symlink to some directory. Instead -- python thinks it is directory (os.path.isdir(PATH)
). So how do I check if a dir is link?
Edit:
Here's what bash
thinks:
~/scl/bkbkshit/Teaching: file 2_-_Classical_Mechanics_\(seminars\)
2_-_Classical_Mechanics_(seminars): symbolic link to `/home/boris/wrk/tchn/2_-_Classical_Mechanics_(seminars)'
and here's what python
thinks:
In [8]: os.path.islink("2_-_Classical_Mechanics_(seminars)/")
Out[8]: False