<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 29, 2011, at 9:50 AM, Stephan wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: 'Bitstream Vera Sans Mono'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">what I'd like is for the twistd daemon to create files with a certain<br>default file creation permission, so I'm looking at changing the<br>umask,<br>but so far I can't get the format correctly, as I'm trying to use what<br>I'd normally use for chmod<br><br>when starting twistd what is the correct format for umask? is what I<br>have correct?<br>desired result is rw for owner, group and world.<br></span></span></blockquote></div><br><div>Not just in twistd, the terms "umask" and "chmod" are basically inverses. &nbsp;chmod sets the permissions of a file to a particular set of bits, but umask _masks out_ those bits on newly created files.</div><div><br></div><div>The mask you want is "execute for everybody" (0b001001001) but you're currently specifying "everything but execute for everybody" (0b110110110). &nbsp;The Python interpreter can help you coerce this to octal, for use as a --umask command line option:</div><div><br></div><div><div>&gt;&gt;&gt; oct(0b001001001)</div><div>'0111'</div></div><div><br></div><div>Hope this helps,</div><div><br></div><div>-glyph</div></body></html>