MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / islink

Function islink

tools/python-3.11.9-amd64/Lib/posixpath.py:164–170  ·  view source on GitHub ↗

Test whether a path is a symbolic link

(path)

Source from the content-addressed store, hash-verified

162# This will always return false on systems where os.lstat doesn't exist.
163
164def islink(path):
165 """Test whether a path is a symbolic link"""
166 try:
167 st = os.lstat(path)
168 except (OSError, ValueError, AttributeError):
169 return False
170 return stat.S_ISLNK(st.st_mode)
171
172# Being true for dangling symbolic links is also useful.
173

Callers

nothing calls this directly

Calls 1

lstatMethod · 0.80

Tested by

no test coverage detected