windows 7 create directory with read write execute permission foreverybody

Discussion in 'Python' started by Gelonida, Jun 26, 2011.

  1. Gelonida

    Gelonida Guest

    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.
     
    Gelonida, Jun 26, 2011
    #1
    1. Advertising

  2. Re: windows 7 create directory with read write execute permissionfor everybody

    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.


    > 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
     
    Irmen de Jong, Jun 26, 2011
    #2
    1. Advertising

  3. Gelonida

    Gelonida Guest

    Re: windows 7 create directory with read write execute permissionfor everybody

    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.
     
    Gelonida, Jun 26, 2011
    #3
  4. Gelonida

    Gelonida Guest

    Re: windows 7 create directory with read write execute permissionfor everybody

    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.
     
    Gelonida, Jun 26, 2011
    #4
  5. Re: windows 7 create directory with read write execute permissionfor everybody

    On 26-6-2011 23:53, Gelonida wrote:
    >
    > 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.


    Maybe this is a bit of a help:
    http://timgolden.me.uk/python/win32_how_do_i/add-security-to-a-file.html

    Irmen
     
    Irmen de Jong, Jun 26, 2011
    #5
  6. Re: windows 7 create directory with read write execute permission for everybody

    * 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
     
    Thorsten Kampe, Jun 27, 2011
    #6
  7. Hi!

    +1

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

    @-salutations
    --
    Michel Claveau
     
    Michel Claveau - MVP, Jun 27, 2011
    #7
  8. Re: windows 7 create directory with read write execute permission for everybody

    * 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
     
    Thorsten Kampe, Jun 27, 2011
    #8
  9. Gelonida

    Gelonida Guest

    Re: windows 7 create directory with read write execute permissionfor everybody

    On 6/27/2011 7:21 AM, Thorsten Kampe wrote:
    > * 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).

    :) 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


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

    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

    >
    > Thorsten
     
    Gelonida, Jun 27, 2011
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Urs Eichmann
    Replies:
    2
    Views:
    1,857
    Steven Cheng[MSFT]
    Apr 11, 2005
  2. Qiangning Hong
    Replies:
    2
    Views:
    371
    Larry Bates
    Dec 13, 2004
  3. Create folder with only read permission

    , Feb 7, 2007, in forum: ASP .Net Security
    Replies:
    0
    Views:
    117
  4. Jimmy

    no permission to create directory

    Jimmy, Mar 22, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    161
    Teemu Keiski
    Mar 22, 2005
  5. Prasath
    Replies:
    0
    Views:
    176
    Prasath
    Oct 14, 2004
Loading...

Share This Page