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

Function ismount

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

Test whether a path is a mount point (a drive root, the root of a share, or a mounted volume)

(path)

Source from the content-addressed store, hash-verified

288except ImportError:
289 _getvolumepathname = None
290def ismount(path):
291 """Test whether a path is a mount point (a drive root, the root of a
292 share, or a mounted volume)"""
293 path = os.fspath(path)
294 seps = _get_bothseps(path)
295 path = abspath(path)
296 root, rest = splitdrive(path)
297 if root and root[0] in seps:
298 return (not rest) or (rest in seps)
299 if rest and rest in seps:
300 return True
301
302 if _getvolumepathname:
303 x = path.rstrip(seps)
304 y =_getvolumepathname(path).rstrip(seps)
305 return x.casefold() == y.casefold()
306 else:
307 return False
308
309
310# Expand paths beginning with '~' or '~user'.

Callers

nothing calls this directly

Calls 5

_get_bothsepsFunction · 0.85
abspathFunction · 0.70
splitdriveFunction · 0.70
rstripMethod · 0.45
casefoldMethod · 0.45

Tested by

no test coverage detected