listdir

ssapy.io.listdir(dir_path='*', files_only=False, exclude=None, sorted=False, index=0)[source][source]

Lists files and directories in a specified path with optional filtering and sorting.

Parameters:

dir_pathstr, default=’*’

The directory path or pattern to match files and directories.

files_onlybool, default=False

If True, only returns files, excluding directories.

excludestr or None, optional

If specified, excludes files and directories whose base name contains this string.

sortedbool, default=False

If True, sorts the resulting list by numeric values in filenames.

indexint, default=0

sorted required to be true. Index of the digit used for sorting.

Returns:

list

A list of file or directory paths based on the specified filters and sorting.