[Twisted-web] default file creation when using reactor.spawnProcess
glyph at twistedmatrix.com
Mon Aug 29 13:03:29 EDT 2011
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
> 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:
Hope this helps,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-web