copy_files#

atomate2.common.files.copy_files(src_dir: str | Path, dest_dir: str | Path | None = None, src_host: str | None = None, include_files: list[str | Path] | None = None, exclude_files: list[str | Path] | None = None, suffix: str = '', prefix: str = '', allow_missing: bool = False, file_client: FileClient | None = None)[source]#

Copy files between source and destination folders.

Parameters
src_dirstr or Path

The source directory.

dest_dirstr or Path or None

The destination directory.

src_hoststr 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_filesNone 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_filesNone or list of (str or Path)

Filenames to exclude. Supports glob file matching, e.g., “*.dat”.

suffixstr

A suffix to add to copied files. For example “.original”.

prefixstr

A prefix to add to copied files. For example “original.”.

allow_missingbool

Whether to error if a file in include_files is not present in the source directory.

file_clientFileClient

A file client to use for performing file operations.