shutil

Utility functions for copying and archiving files and directory trees.

XXX The functions here don’t copy the resource fork or other metadata on Mac.

Functions

abspath(path) Return an absolute path.
copy(src, dst) Copy data and mode bits (“cp src dst”).
copy2(src, dst) Copy data and all stat info (“cp -p src dst”).
copyfile(src, dst) Copy data from src to dst
copyfileobj(fsrc, fdst[, length]) copy data from file-like object fsrc to file-like object fdst
copymode(src, dst) Copy mode bits from src to dst
copystat(src, dst) Copy all stat info (mode bits, atime, mtime, flags) from src to dst
copytree(src, dst[, symlinks, ignore]) Recursively copy a directory tree using copy2().
get_archive_formats() Returns a list of supported formats for archiving and unarchiving.
getgrnam(...) Return the group database entry for the given group name.
getpwnam((name) -> (pw_name,pw_passwd,pw_uid,) pw_gid,pw_gecos,pw_dir,pw_shell)
ignore_patterns(*patterns) Function that can be used as copytree() ignore parameter.
make_archive(base_name, format[, root_dir, ...]) Create an archive file (eg.
move(src, dst) Recursively move a file or directory to another location.
register_archive_format(name, function[, ...]) Registers an archive format.
rmtree(path[, ignore_errors, onerror]) Recursively delete a directory tree.
unregister_archive_format(name)

Exceptions

Error
ExecError Raised when a command could not be executed
SpecialFileError Raised when trying to do a kind of operation (e.g.