473,322 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Re: Creating directories

--- On Fri, 9/5/08, srinivasan srinivas <sr*********@yahoo.co.inwrote:
From: srinivasan srinivas <sr*********@yahoo.co.in>
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??
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
Sep 5 '08 #1
0 1054

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ricco DeCicco | last post by:
Hi All I have just reinstalled VStudio.Net (VB.Net) and the .Net Framewor and I can successfully open an existing project for editin 'UserControlSample' When I try to create a new project...
3
by: dave | last post by:
I am using vs.net 2003 on windows xp. After clicking on a project within my solution and selecting create new folder vs.net responds back with , the "directory already exists". If i look at the...
6
by: Ferrari, Eduardo | last post by:
Hi all! I'm trying to create this XML file: <?xml version="1.0" encoding="utf-8" ?> <Build type="Daily" sync="True" compile="True" assemble="True" > <Sync version="1.0.0.0" branch="QA">...
6
by: Eran Kampf | last post by:
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath("/")+"test" as the folder) and I am getting a DirectoryNotFoundException saying "Could not find a...
1
by: Senthil | last post by:
Con is the file name for a reserved device name(i think it is for console). So you cannot create a file with name 'con'. choose some other name senthil >-----Original Message----- >Hi...
3
by: Stelrad Doulton | last post by:
Hi, I am having a strange problem on IIS 6.0. I am trying to create directories under a virtual directory on the fly to which I will upload files and retrieve these files later. I am having 2...
3
by: epigram | last post by:
I've been creating some toy ASP.NET apps in an effort to understand the technology. I've something odd with regards to project/solution creation. If you create a new asp.net application, it...
6
by: Charlie Bear | last post by:
i'm really stuck with this one can anyone help! i have a website that uses c#. it creates a series of directories and files from an xml source. when the xml changes, the directory that the...
3
by: veaux | last post by:
Adobe has WAY to many forums and I wasn't sure which was correct so thought I'd try here first. I'm trying to see if there is a product that will allow us to create a large (1,100 pg) directory,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.