something similar to shutil.copytree that can overwrite?

Justin Ezequiel justin.mailinglists at gmail.com
Fri Jun 22 03:34:00 CEST 2007


def copytree(src, dst, symlinks=False):
    """Recursively copy a directory tree using copy2().

    The destination directory must not already exist.

    XXX Consider this example code rather than the ultimate tool.

    """
    names = os.listdir(src)
    if not os.path.exists(dst): os.makedirs(dst) # add check here




More information about the Python-list mailing list