MCPcopy Index your code
hub / github.com/python/cpython / isreserved

Function isreserved

Lib/ntpath.py:311–316  ·  view source on GitHub ↗

Return true if the pathname is reserved by the system.

(path)

Source from the content-addressed store, hash-verified

309)
310
311def isreserved(path):
312 """Return true if the pathname is reserved by the system."""
313 # Refer to "Naming Files, Paths, and Namespaces":
314 # https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
315 path = os.fsdecode(splitroot(path)[2]).replace(altsep, sep)
316 return any(_isreservedname(name) for name in reversed(path.split(sep)))
317
318def _isreservedname(name):
319 """Return true if the filename is reserved by the system."""

Callers

nothing calls this directly

Calls 5

splitrootFunction · 0.90
_isreservednameFunction · 0.85
anyFunction · 0.70
replaceMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…