zut.files.copy2

zut.files.copy2(src: str | Path, dst: str | Path, follow_symlinks=True)

Identical to copy() except that copy2() also attempts to preserve the file metadata.

copy2() uses copystat() to copy the file metadata. Please see copystat() for more information about how and what metadata it copies to the dst file.

If follow_symlinks is False, dst will be created as a symbolic link if src is a symbolic link. If follow_symlinks is True, dst will be a copy of the file src refers to.