windows 7 create directory with read write execute permission foreverybody

G

Gelonida

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.


Alternatively it would be even better to specify exactly which users
should be allowed to access the directory tree.

I never used / modified Windows file permissions except once or twice
via explorer. I'm thus a little shaky with Microsoft's file permissions.

Thanks in advance for your answer.
 
I

Irmen de Jong

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.

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.

Irmen
 
G

Gelonida

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 :-( .


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.
 
G

Gelonida

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 :-( .


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.
 
T

Thorsten Kampe

* Gelonida (Sun, 26 Jun 2011 22:57:57 +0200)
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.

Exactly nothing (except creating the directory, of course).
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.

Alternatively it would be even better to specify exactly which users
should be allowed to access the directory tree.

I never used / modified Windows file permissions except once or twice
via explorer. I'm thus a little shaky with Microsoft's file
permissions.

Microsoft's permission handling hasn't changed in the last eleven years.
So you had a lot of time to learn about it. Do you see this "Learn about
access control and permissions" link when you're in the security tab?
Just click on it.

Thorsten
 
M

Michel Claveau - MVP

Hi!

+1

Gelonida confuses "Windows permissions" and "NTFS's rights".
(too) Many Windows users are unfamiliar with Windows.

@-salutations
 
T

Thorsten Kampe

* Gelonida (Sun, 26 Jun 2011 23:53:15 +0200)
On this machine I used os.mkdir() / os.makedirs() and I had permission
problems , but only on Windows7.

Windows file permissions haven't changed since 1995. The only addition
was dynamic inheritance support back in 2000.
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 :-( .

Even Linux file systems have ACL support. It's only that few people use
it since application support is sparse. And it lacks (dynamic)
inheritance which is so 1980s.

Thorsten
 
G

Gelonida

* Gelonida (Sun, 26 Jun 2011 22:57:57 +0200)

Exactly nothing (except creating the directory, of course).
:) I thought so as well.

I asume the security settings of the directory below which I created
mine were setup to give no write permission to Everybody.

If I changed the parent directories security settings with the explorer
everything behaved fine.

So if the parent directories security settings are unknown it seems
mkdir() is not sufficient and I have to use some win32 calls
as mentioned in the url of Tim's reply to have the correct settings.

http://timgolden.me.uk/python/win32_how_do_i/add-security-to-a-file.html

Microsoft's permission handling hasn't changed in the last eleven years.
So you had a lot of time to learn about it.
but never the need so far.
Do you see this "Learn about
access control and permissions" link when you're in the security tab?
Just click on it.
Will click
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top