os.readlink()

os.readlink(path, *, dir_fd=None)

Return a string representing the path to which the symbolic link points. The result may be either an absolute or relative pathname; if it is relative, it may be converted to an absolute pathname using os.path.join(os.path.dirname(path), result).

If the path is a string object, the result will also be a string object, and the call may raise a UnicodeDecodeError. If the path is a bytes object, the result will be a bytes object.

This function can also support paths relative to directory descriptors.

Availability: Unix, Windows

Changed in version 3.2: Added support for Windows 6.0 (Vista) symbolic links.

New in version 3.3: The dir_fd argument.

doc_python
2016-10-07 17:39:30
Comments
Leave a Comment

Please login to continue.