Martin v. Löwis <[EMAIL PROTECTED]> wrote:
> Nick Craig-Wood schrieb:
> > So it looks like python mkdir() is applying the umask where as
> > /bin/mkdir doesn't. From man 2 mkdir
>
> Actually, mkdir(1) has no chance to not apply the umask: it also
> has to use mkdir(2), which is implemented in
Peter Otten <[EMAIL PROTECTED]> wrote:
> >> "Where it is used, the current umask value is first masked out."
> >>
> >> Use os.chmod() after os.mkdir() to get the desired permissions.
> >
> > I think you meant use os.umask(0) before the os.mkdir() ?
>
> No, I didn't. What is the difference/adv
Nick Craig-Wood schrieb:
> So it looks like python mkdir() is applying the umask where as
> /bin/mkdir doesn't. From man 2 mkdir
Actually, mkdir(1) has no chance to not apply the umask: it also
has to use mkdir(2), which is implemented in the OS kernel, and
that applies the umask. Try
strace mkd
> To fix your problem, reset your umask thus :-
Thanks for the detailed reply. Your fix works like a charm.
VJ
--
http://mail.python.org/mailman/listinfo/python-list
Nick Craig-Wood wrote:
> Peter Otten <[EMAIL PROTECTED]> wrote:
>> vj wrote:
>>
>> > How do I do the following unix command:
>> >
>> > mkdir -m770 test
>> >
>> > with the os.mkdir command. Using os.mkdir(mode=0770) ends with the
>> > incorrect permissions.
>>
>> mkdir() works just like its C
vj <[EMAIL PROTECTED]> wrote:
> How do I do the following unix command:
>
> mkdir -m770 test
>
> with the os.mkdir command. Using os.mkdir(mode=0770) ends with the
> incorrect permissions.
You mean :-
$ python -c 'import os; os.mkdir("test", 0770)'
$ stat test/
File: `test/'
Size: 4096
Peter Otten <[EMAIL PROTECTED]> wrote:
> vj wrote:
>
> > How do I do the following unix command:
> >
> > mkdir -m770 test
> >
> > with the os.mkdir command. Using os.mkdir(mode=0770) ends with the
> > incorrect permissions.
>
> mkdir() works just like its C equivalent, see
> http://docs.pyth
vj wrote:
> How do I do the following unix command:
>
> mkdir -m770 test
>
> with the os.mkdir command. Using os.mkdir(mode=0770) ends with the
> incorrect permissions.
mkdir() works just like its C equivalent, see
http://docs.python.org/dev/lib/os-file-dir.html:
"Where it is used, the current
On 1 Dec 2006 23:17:50 -0800, vj <[EMAIL PROTECTED]> wrote:
How do I do the following unix command:
mkdir -m770 test
with the os.mkdir command. Using os.mkdir(mode=0770) ends with the
incorrect permissions.
Thanks,
VJ
--
http://mail.python.org/mailman/listinfo/python-list
using
os.mkd
How do I do the following unix command:
mkdir -m770 test
with the os.mkdir command. Using os.mkdir(mode=0770) ends with the
incorrect permissions.
Thanks,
VJ
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo