copytree if directory exists

Thomas Guettler guettli at
Thu Nov 25 14:31:38 CET 2004


I need to copy a directory into an existing directory.
shutil.copytree does complain that the directory already

I need something like "cp -rp": Copy recursively, overwrite
if file already exist. Preserve mtime and modes if possible.

A keyword argument "may_exist=1" for shutil.copytree would be nice.


More information about the Python-list mailing list