-
-
Save MorganRamsay/092e2d5dcd41267e02d91a297b0dd961 to your computer and use it in GitHub Desktop.
Python 3.6.4 os.path.islink (ntpath.py) - fixed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def islink(path): | |
"""Test whether a path is a symbolic link. | |
This will always return false for Windows prior to 6.0. | |
""" | |
try: | |
st = os.lstat(path) | |
except (OSError, AttributeError): | |
return False | |
return stat.S_ISLNK(st.st_mode) or st.st_file_attributes & stat.FILE_ATTRIBUTE_REPARSE_POINT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment