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
  • directory (str) – The directory to search for files.

  • fullpath (bool, optional) – Specifies if the returned list of strings is with the full path.

  • extensions (list 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.