Message107840
>I don't understand what you mean when you say "how umask works in
>relation to Python". How it works in relation to Python isn't different
>from how it works for any other Unix program. Consider, for example,
>the unix man page for 'open'.
This is what I mean.
The following gnu commands give (on Archlinux):
$ umask
0022
$ mkdir test1
$ mkdir test2 --mode 0777
$ ls -l
drwxr-xr-x 2 sindrero users 4096 Jun 15 00:59 test
drwxrwxrwx 2 sindrero users 4096 Jun 15 00:59 test2
So we see that new folder created with the --mode parameter to gnu's mkdir does not get the umask masked out.
The following code in python gives:
>> import os
>> os.mkdir('test3')
>> os.mkdir('test4')
>> exit()
$ ls -l
drwxr-xr-x 2 sindrero users 4096 Jun 15 01:01 test3
drwxr-xr-x 2 sindrero users 4096 Jun 15 01:01 test4
I (as a programmer) have never seen the specific code for python's mkdir function, And I have no way to know whether I should presume that mkdir in python works the same way as the gnu command or not. Unless it is documented that is.
Cheers :) |
|
Date |
User |
Action |
Args |
2010-06-14 23:13:26 | smyrman | set | recipients:
+ smyrman, loewis, r.david.murray, jab |
2010-06-14 23:13:26 | smyrman | set | messageid: <1276557206.37.0.557040933884.issue5220@psf.upfronthosting.co.za> |
2010-06-14 23:13:24 | smyrman | link | issue5220 messages |
2010-06-14 23:13:24 | smyrman | create | |
|