something similar to shutil.copytree that can overwrite?

Justin Ezequiel justin.mailinglists at gmail.com
Thu Jun 21 21:34:00 EDT 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