[Tutor] Copy without overwrite?

Kent Johnson kent_johnson at skillsoft.com
Tue Sep 21 14:17:06 CEST 2004


shutil.copytree() is almost what you want. You could copy it (from 
Python/Lib/shutil.py) and check os.path.exists() before the actual copying 
is done.

At 11:59 AM 9/21/2004 +0200, Bernard Lebel wrote:
>Hello,
>
>Is there a simple way to copy files and directory without any overwriting 
>if the destination tree
>structure contains files and directory of the same name? Basically that 
>would just add new elements
>to the destination structure, and leave the existing structure intact.
>
>
>Thanks
>Bernard
>
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list