something similar to shutil.copytree that can overwrite?

Ben Sizer kylotan at gmail.com
Thu Jun 21 07:05:39 EDT 2007


On 20 Jun, 11:40, Justin Ezequiel <justin.mailingli... at gmail.com>
wrote:
> On Jun 20, 5:30 pm, Ben Sizer <kylo... at gmail.com> wrote:
>
> > I need to copy directories from one place to another, but it needs to
> > overwrite individual files and directories rather than just exiting if
> > a destination file already exists.
>
> What version of Python do you have?
> Nothing in the source would make it exit if a target file exists.
> (Unless perhaps you have sym-links or the like.)

I have 2.5, and I believe the behaviour I saw was that it exits if a
directory already exists and it skips any files that already exist. It
certainly wouldn't overwrite anything.

--
Ben Sizer





More information about the Python-list mailing list