list_files_in_directory

compas_fab.utilities.list_files_in_directory(directory, fullpath=False, extensions=None)[source]

This function lists just the files in a directory, not sub-directories.

Parameters:
directorystr

The directory to search for files.

fullpathbool, optional

Specifies if the returned list of strings is with the full path.

extensionslist of str, optional

A list of allowed extensions, e.g. [“jpg”, “png”] if you just want to list images.

Returns:
list of str

A list of files as string if files exist, or empty list.