uos.path
– Filesystem functions¶
This module contains miscellaneous functions on filesystem paths.
Functions¶
- uos.path.isfile(path)¶
Check if a
path
to a file is an existing regular file.- Parameters
path (str) – Full path to the file.
- Returns
True
if thepath
is anexisting
regular file.- Return type
bool
- uos.path.isdir(path)¶
Check if a
path
to a directory is an existing directory.- Parameters
path (str) – Full path to the directory.
- Returns
True
if thepath
is anexisting
directory.- Return type
bool
- uos.path.exists(path)¶
Check if a
path
is an existing file or directory.- Parameters
path (str) – Full path to the file or directory.
- Returns
True
if thepath
references an existing file or directory.- Return type
bool
Note
This function may return
False
if permission is not granted to executeos.stat()
on the requested file, even if thepath
exists.