Teracopy File Permissions
Unix File Permissions
Jun 26, 2012 Using Richcopy to copy shares and permissions. This will try to give you permission to back up files you don't specifically have permission to. The docs of shutil tells me: Even the higher-level file copying functions (shutil.copy(), shutil.copy2()) can’t copy all file metadata. On POSIX platforms, this. Jun 27, 2012 Using Richcopy to copy shares and permissions. Probabaly have to go and 'take ownership' of the files you don't have permission to and give.
File Permissions Windows
I suggest you use the OS and subprocess modules. This will only work in Unix, but it should work well. Use the os.fchown to change file ownership, and subprocess.Popen to pipe ls -l into a variable to read ownership. For one file, the permissions reader would look like this: import os import subprocess def readfile(filepath): process = subprocess.Popen('ls','-l',stdout=subprocess.PIPE) output = process.communicate0 output = output.split return (output0,output1) #insert into this tuple the indexing for the words you want from ls -l and for the uid setter (just a wrapper for os function): def setuid(filepath,uid,gid): os.chown(filepath,uid,gid).