idmtools.utils.file module

idmtools.utils.file.scan_directory(basedir: str, recursive: bool = True) → Iterable[posix.DirEntry]

Scan a directory recursively or not.

Parameters
  • basedir – The root directory to start from.

  • recursive – True to search the subfolders recursively; False to stay in the root directory.

Returns

An iterator yielding all the files found.

idmtools.utils.file.file_contents_to_generator(filename, chunk_size=128) → Generator[bytearray, None, None]

Create a generator from file contents in chunks(useful for streaming binary data and piping) :param filename: :param chunk_size:

Returns: