pyufunc.check_files_in_dir#

pyufunc.check_files_in_dir(filenames, dir_path='', incl_subdir=False)#

Check if provided list of files exist in the given directory.

Location:

pyufunc/util_pathio/_path.py

References

xyluo25/utdf2gmns (Apache) mikeqfu/pyhelpers (GNU)

Parameters:
  • filenames (list[str | Path]) – a list of filenames to be checked

  • dir_path (str | Path, optional) – the given directory. Defaults to “”. if dir_path is not given, use the current working directory

  • incl_subdir (bool) – Whether to search files inside subdirectories. Defaults to False.

Returns:

True if all files exist in the given directory, otherwise False

Return type:

bool

Examples

>>> import pyufunc as uf
>>> uf.check_files_existence(['./test.py', './test.txt'])
False