--- On Fri, 9/5/08, srinivasan srinivas <[EMAIL PROTECTED]> wrote:

> From: srinivasan srinivas <[EMAIL PROTECTED]>
> 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.
[EMAIL PROTECTED]:~$ cd /tmp/
[EMAIL PROTECTED]:/tmp$ mkdir test
[EMAIL PROTECTED]:/tmp$ ls -ld test
drwxr-xr-x 2 dwright dwright 1024 2008-09-04 05:19 test
[EMAIL PROTECTED]:/tmp$ ls -la test
drws------  2 dwright dwright 1024 2008-09-04 05:19 .
drwxrwxrwt 13 root    root    3072 2008-09-04 05:19 ..
[EMAIL PROTECTED]:/tmp$ chmod 2700 test
[EMAIL PROTECTED]:/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 ..

[EMAIL PROTECTED]:~$ python
Python 2.4.4 
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.mkdir('/tmp/test/TEST', 0700)

[EMAIL PROTECTED]:/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

[EMAIL PROTECTED]:/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
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to