|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Permission denied in Python when copying files
I start in Python and I'm pretty bad in the program in general. Here is my situation: Here is the tree: C:\MySoft\MyFolder C:\Shift In MyFolder: AppliCommon ObjectMetier Main In Shift: AppliCommon Main The purpose of the script is to update an application that is done by replacing files. Therefore, I must first save and then replace MyFolder by MyFolder files by folders and files in SHIFT. Note that all files contain several sub-folders and files. I've done this: Code: src = r'C:\Shift' dst = r'C:\MySoft\\MyFolder ' for f in os.listdir (src): shutil.copy (os.path.join (src, f), os.path.join (dst, f)) Quote:
|
#2
| |||
| |||
Re: Permission denied in Python when copying files
You do not have rights to c:\shift\main. Incidentally, shutil has a copytree making a recursive copy alone as a great, no need to make a combo & listdir copy. |
#3
| |||
| |||
Re: Permission denied in Python when copying files
The problem is that I see no reason why I would have no rights. I am in my local post office, admin, I'm not in a domain, I am owner of the file. For the copytree it seems to me the need for the remote folder does not exist. However, there is, I just updated or I'm wrong? |
#4
| |||
| |||
Re: Permission denied in Python when copying files Quote:
But if you want "just" sync two folders, you can not use rsync in external process? (or if the files are not too big, you delete the destination and you copytree) |
#5
| |||
| |||
Re: Permission denied in Python when copying files
These are large files containing several thousand files. I took only 3 files to simplify the example. Basically what I need is get the update file in to replace the files in MyFolder. But I did not update the full records in myaccount only record to be updated. |
![]() |
|
Tags: permission denied, python |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ubuntu, Unable to move files, error: Permission Denied | PhanA | Operating Systems | 5 | 10-09-2011 07:55 AM |
Permission denied when opening gamespot | thortheviking | Software Development | 9 | 21-05-2010 12:13 AM |
Denied permission to access folders | Jack K | Vista Help | 16 | 27-02-2010 07:18 PM |
Access is Denied When Copying NTLDR | neuro | Hardware Peripherals | 2 | 19-08-2009 08:23 PM |
Vista and Permission Denied | Hamsa! | Vista Help | 1 | 23-02-2008 10:52 PM |