Re: Creating directories

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • david wright

    Re: Creating directories

    --- On Fri, 9/5/08, srinivasan srinivas <sri_annauni@ya hoo.co.inwrote:
    From: srinivasan srinivas <sri_annauni@ya hoo.co.in>
    Subject: Creating directories
    To: python-list@python.org
    Date: Friday, September 5, 2008, 1:44 AM
    Can someone tell me is there any module available to create
    directories??
    >
    I tried os, tempfile.
    I was facing some issues with os.mkdir(). The mode setting
    was not proper with this method.
    >
    I created the directory 'stdin' with '0700'
    mode using os.mkdir() method.
    $ls -alR stdin/
    stdin/:
    total 12
    drwx--S--- 2 munisams munisams 4096 Sep 3 02:00 .
    What is that 'S' in the group permission field??
    >
    this appears to be working, what where you expecting?

    "An upper case "S" means there is no executable permission, but the set group id function is active- that is, a file in this directory will belong to the same group id as the directory itself."


    If the parent directory has the set group id set, the child will as well.
    i.e.
    dwright@debian: ~$ cd /tmp/
    dwright@debian:/tmp$ mkdir test
    dwright@debian:/tmp$ ls -ld test
    drwxr-xr-x 2 dwright dwright 1024 2008-09-04 05:19 test
    dwright@debian:/tmp$ ls -la test
    drws------ 2 dwright dwright 1024 2008-09-04 05:19 .
    drwxrwxrwt 13 root root 3072 2008-09-04 05:19 ..
    dwright@debian:/tmp$ chmod 2700 test
    dwright@debian:/tmp$ ls -la test
    total 4
    drwx--S--- 2 dwright dwright 1024 2008-09-04 05:19 .
    drwxrwxrwt 13 root root 3072 2008-09-04 05:19 ..

    dwright@debian: ~$ python
    Python 2.4.4
    Type "help", "copyright" , "credits" or "license" for more information.
    >>import os
    >>os.mkdir('/tmp/test/TEST', 0700)
    dwright@debian:/tmp$ ls -la test
    total 5
    drwx--S--- 3 dwright dwright 1024 2008-09-04 05:20 .
    drwxrwxrwt 13 root root 3072 2008-09-04 05:19 ..
    drwx--S--- 2 dwright dwright 1024 2008-09-04 05:20 TEST

    dwright@debian:/tmp$ ls -la test/TEST
    total 2
    drwx--S--- 2 dwright dwright 1024 2008-09-04 05:20 .
    drwx--S--- 3 dwright dwright 1024 2008-09-04 05:20 ..

    +David
Working...