Hi Michel, Thanks for the response. Yes that's an option available. I've already tried this for setting permissions on files and folders. Since each invocation constitutes a System Call, it fills up the stack easily and the OS denies the handle thereafter. I'm trying to achieve it in a more native and pythonic way.
Regards, Goku Le 20.03.17 ? 16:13, Goku Balu a ?crit : > > Hi all, > > > > Is there anyway to do "Replace all child object permissions with > > inheritable permissions from this object" programatically using > > PyWin32. I found out that this resets the permissions for all the > > sub-folders and files deep-down even though the permissions are set > > separately. > > > > def remove_permission(path): > > sd = win32security.GetFileSecurity(path, > > win32security.DACL_SECURITY_INFORMATION) > > dacl = sd.GetSecurityDescriptorDacl() # instead of dacl = > > win32security.ACL() > > win32security.SetNamedSecurityInfo(path, > > win32security.SE_FILE_OBJECT, win32security.DACL_SECURITY_INFORMATION > > | win32security.UNPROTECTED_DACL_SECURITY_INFORMATION, None, None, > > dacl, None) > > > > I tried this on a folder. But didn't work. > > Hi! > > You can call the Windows's command* CACLS *(in command line). > > @+ > -- > Michel Claveau >
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32