From: srinivasan srinivas <sr*********@yahoo.co.in>this appears to be working, what where you expecting?
Subject: Creating directories
To: py*********@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??
"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.
dwright@debian:/tmp$ ls -la test>>import os
os.mkdir('/tmp/test/TEST', 0700)
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