Follow a symlink POSIX

suggest change

Sometimes 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))

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents