Re: default file creation when using reactor.spawnProcess

Stephan <[email protected]>
Newsgroups gmane.comp.python.twisted.web
Message-ID <CADozHMWgz+ZXxT3URDpsx+M=se3ob8ZomJ+MpK8X9ZKgGzqjOg@mail.gmail.com>
Thanks Glyph,

I've been coding all night, I should have known umask from chmod
but in order to accomplish the correct chmod I believe this is what I need:

unmask=000 	
results in chmod = 666 (rw-rw-rw-)

right? I realize this is now off topic, but just wanted to make sure
it was correct.
explicitly setting the umask I believe will fix the issue, testing now...

Stephan

On Mon, Aug 29, 2011 at 10:03 AM, Glyph Lefkowitz
<[email protected]> wrote:
>
> On Aug 29, 2011, at 9:50 AM, Stephan wrote:
>
> what I'd like is for the twistd daemon to create files with a certain
> default file creation permission, so I'm looking at changing the
> umask,
> but so far I can't get the format correctly, as I'm trying to use what
> I'd normally use for chmod
>
> when starting twistd what is the correct format for umask? is what I
> have correct?
> desired result is rw for owner, group and world.
>
> Not just in twistd, the terms "umask" and "chmod" are basically inverses.
>  chmod sets the permissions of a file to a particular set of bits, but umask
> _masks out_ those bits on newly created files.
> The mask you want is "execute for everybody" (0b001001001) but you're
> currently specifying "everything but execute for everybody" (0b110110110).
>  The Python interpreter can help you coerce this to octal, for use as a
> --umask command line option:
>>>> oct(0b001001001)
> '0111'
> Hope this helps,
> -glyph
> _______________________________________________
> Twisted-web mailing list
> [email protected]
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.