copy_files

atomate2.common.files.copy_files(src_dir, dest_dir=None, src_host=None, include_files=None, exclude_files=None, suffix='', prefix='', allow_missing=False, file_client=None, link_files=False)[source]

Copy files between source and destination folders.

Parameters:
  • src_dir (str or Path) – The source directory.

  • dest_dir (str or Path or None) – The destination directory.

  • src_host (str or None) – The source hostname used to specify a remote filesystem. Can be given as either “usernamehost” or just “host” in which case the username will be inferred from the current user. If None, the local filesystem will be used as the source.

  • include_files (None or list of (str or .Path)) – Filenames to include as a list of str or Path objects given relative to src_dir. Glob file paths are supported, e.g. “*.dat”. If None, all files in the source directory will be copied.

  • exclude_files (None or list of (str or .Path)) – Filenames to exclude. Supports glob file matching, e.g., “*.dat”.

  • suffix (str) – A suffix to add to copied files. For example “.original”.

  • prefix (str) – A prefix to add to copied files. For example “original.”.

  • allow_missing (bool) – Whether to error if a file in include_files is not present in the source directory.

  • file_client (.FileClient) – A file client to use for performing file operations.

  • link_files (bool) – Whether to link the files instead of copying them. This option will raise an error if it is used in combination with a file_client.

Return type:

None