Follow a symlink POSIX
suggest changeSometimes you need to determine the target of a symlink. os.readlink will do this. This assumes import os, and path_to_symlink must name a symlink. On Windows, os.readlink also reads a symlink. It raises OSError when the path is not one:
print(os.readlink(path_to_symlink))
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents