delete_files
delete_files#
- atomate2.common.files.delete_files(directory: str | Path | None = None, host: str | None = None, include_files: list[str | Path] | None = None, exclude_files: list[str | Path] | None = None, allow_missing: bool = False, file_client: FileClient | None = None)[source]#
Delete files in a directory.
- Parameters
- directory
str
orPath
orNone
Directory in which to delete files. If
None
, the current directory will be used (or home folder if specifying a remote host).- host
str
orNone
The hostname used to specify a remote filesystem. Can be given as either “username@host” or just “host” in which case the username will be inferred from the current user. If
None
, the local filesystem will be used.- include_files
None
orlist
of
(str
orPath
) Filenames to include as a list of str or Path objects given relative to directory. Glob file paths are supported, e.g. “*.dat”. If
None
, all files in the directory will be deleted.- exclude_files
None
orlist
of
(str
orPath
) Filenames to exclude. Supports glob file matching, e.g., “*.dat”.
- allow_missingbool
Whether to error if a file in
include_files
is not present in the directory.- file_client
FileClient
A file client to use for performing file operations.
- directory