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

Function _follow_symlinks

tools/python-3.11.9-amd64/Lib/platform.py:590–599  ·  view source on GitHub ↗

In case filepath is a symlink, follow it until a real file is reached.

(filepath)

Source from the content-addressed store, hash-verified

588 return default
589
590def _follow_symlinks(filepath):
591
592 """ In case filepath is a symlink, follow it until a
593 real file is reached.
594 """
595 filepath = os.path.abspath(filepath)
596 while os.path.islink(filepath):
597 filepath = os.path.normpath(
598 os.path.join(os.path.dirname(filepath), os.readlink(filepath)))
599 return filepath
600
601
602def _syscmd_file(target, default=''):

Callers 1

_syscmd_fileFunction · 0.85

Calls 2

readlinkMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected