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 the path is an existing 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 the path is an existing 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 the path references an existing file or directory.

Return type:

bool

Note

This function may return False if permission is not granted to execute os.stat() on the requested file, even if the path exists.