uos.path – Filesystem functions¶
This module contains miscellaneous functions on filesystem paths.
Functions¶
- uos.path.isfile(path)¶
Check if a
pathto a file is an existing regular file.- Parameters
path (str) – Full path to the file.
- Returns
Trueif thepathis anexistingregular file.- Return type
bool
- uos.path.isdir(path)¶
Check if a
pathto a directory is an existing directory.- Parameters
path (str) – Full path to the directory.
- Returns
Trueif thepathis anexistingdirectory.- Return type
bool
- uos.path.exists(path)¶
Check if a
pathis an existing file or directory.- Parameters
path (str) – Full path to the file or directory.
- Returns
Trueif thepathreferences an existing file or directory.- Return type
bool
Note
This function may return
Falseif permission is not granted to executeos.stat()on the requested file, even if thepathexists.