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

Function islink

tools/python-3.11.9-amd64/Lib/ntpath.py:256–264  ·  view source on GitHub ↗

Test whether a path is a symbolic link. This will always return false for Windows prior to 6.0.

(path)

Source from the content-addressed store, hash-verified

254# This will always return false on systems where os.lstat doesn't exist.
255
256def islink(path):
257 """Test whether a path is a symbolic link.
258 This will always return false for Windows prior to 6.0.
259 """
260 try:
261 st = os.lstat(path)
262 except (OSError, ValueError, AttributeError):
263 return False
264 return stat.S_ISLNK(st.st_mode)
265
266# Being true for dangling symbolic links is also useful.
267

Callers 2

_walkFunction · 0.70
_readlink_deepFunction · 0.70

Calls 1

lstatMethod · 0.80

Tested by

no test coverage detected