copytree if directory exists

Thomas Guettler guettli at thomas-guettler.de
Thu Nov 25 14:31:38 CET 2004


Hi,

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

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.

 Thomas




More information about the Python-list mailing list