windows 7 create directory with read write execute permission for everybody

Gelonida gelonida at gmail.com
Sun Jun 26 17:53:15 EDT 2011


On 6/26/2011 11:24 PM, Irmen de Jong wrote:
> On 26-6-2011 22:57, Gelonida wrote:
>> Hi,
>>
>> What do I have to do under python windows to create a directory with all permissions,
>> such, that new files / directories created below will inherit the permissions.
>>
>> The reason I am asking is, that I'd like to create a directory structure where multiple
>> users should be allowed to read / write / create files and directories.
>
> Isn't this the default when you create a new directoy in Windows? (unless you're
> creating it in some location where access is restricted, for instance C:\ or c:\program
> files).  I'd try os.mkdir first in any case and check if it does the job.
>
Have to check when I'm back to the machine in question.

On this machine I used os.mkdir() / os.makedirs() and I had permission 
problems , but only on Windows7. This is why I was asking the question.

I expect, that the win32 libraries might have function calls allowing to 
control the permissions of a directory, but I am really bad with win32 
as I worked mostly with Linux or code, that was platform independent, 
which Windows file permission handling is not :-( .



>
>> Alternatively it would be even better to specify exactly which users should be allowed
>> to access the directory tree.
>
> Sorry, can't help you with this. I guess you'll need to use the windows extensions for
> Python here and deal with user accounts and ACL's.

Yep I'm afraid that's the way to go and where I hoped somebody would 
have a few tiny example lines or pointers to the functions in question 
to be used.







More information about the Python-list mailing list