On this page
ntpath.isreserved
Prev: ntpath.ismount | Up: ntpath | Next: ntpath.join
Rel: ntpath.abspath, ntpath.basename, ntpath.commonpath, ntpath.commonprefix
Ref: docs.python.org — ntpath.isreserved
Tags: #public #python3 #stdlib #ntpath
Import
import ntpath
from ntpath import isreserved
Signature & Overview
ntpath.isreserved(path)
Return true if the pathname is reserved by the system.
Usage
import ntpath
if hasattr(ntpath, 'isreserved'):
assert ntpath.isreserved('CON') is True
assert ntpath.isreserved('normal.txt') is False
Gotchas
- Requires Python 3.13+: Detects Windows reserved device names (
CON,PRN,AUX,NUL,COM1..COM9,LPT1..LPT9).
REPL Inspect
from ntpath import isreserved
help(isreserved)
Linked from
Related notes
- tuts/python3/stdlib_module/ntpath/ismount Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/join Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ntpath/abspath Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/basename Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/commonpath Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/commonprefix Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/dirname shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/exists shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/expanduser shared tags: #ntpath, #stdlib