> Delete, then copy. Or use rsync instead of Python...
Yes, I ended up writing a small *.bat file that uses unison for
sychronization.
I still do not understand why I got these permission errors when using
the python script.
Thanks for the help.
___
Timmie wrote:
> Which command do you recommend if the destination already exists?
> I'd like to overwrite or sychronise a local with a remote directory and
> therefore the destinations files already exist.
Delete, then copy. Or use rsync instead of Python...
Kent
_
Thanks for your reply!
> The destination path should not already exist, it should end with the
> directory you want to create. Did you read the docs for copytree()? They
> say, "The destination directory, named by dst, must not already exist;
> it will be created as well as missing parent direc
Timmie wrote:
> ## config ##
> source = 'C:/my/local/directory'
> dest = 'Z:/my/network/drive'
> ## start action
> #os.remove(dest)
>
> ## error output
> Traceback (most recent call last):
> File "test_os_on_win", line 14, in
> os.remove(dest)
> WindowsError: [Error 5] Zugriff verw
Dear list,
I have some problems using the os module on windows. I kindly ask you do give me
advice why os.remove and os.shutil fail here:
### using remove
##
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import shutil
import os
## config ##
source = 'C:/my/local/directory'
dest = 'Z:/my