Comment by vetinari

5 years ago

That's different thing; the copied data includes only file data itself, not metadata. From the documentation

- on shutil.copyfile:

> Copy the contents (no metadata) of the file named src to a file named dst and return dst in the most efficient way possible. src and dst are path-like objects or path names given as strings.

- on "Platform-dependent efficient copy operations":

> On macOS fcopyfile is used to copy the file content (not metadata).

On top of the shutil module:

> Warning

> Even the higher-level file copying functions (shutil.copy(), shutil.copy2()) cannot copy all file metadata.

> On POSIX platforms, this means that file owner and group are lost as well as ACLs. On Mac OS, the resource fork and other metadata are not used. This means that resources will be lost and file type and creator codes will not be correct. On Windows, file owners, ACLs and alternate data streams are not copied.