khamidou / lptrace

Trace any Python program, anywhere!
http://khamidou.com/lptrace/
GNU General Public License v3.0
699 stars 43 forks source link

octal literal in os.chmod? #1

Closed lambdaq closed 7 years ago

lambdaq commented 7 years ago
os.chmod(tmp.name, 0666)
os.chmod(fifo_name, 0777)

So 0666 === 438 and 0777 == 511 is these two lines intentional or a typo?

beardypig commented 7 years ago

*nix file permissions are octal, so this appears to be intentional as well as correct. This Wikipedia page has a breakdown, https://en.wikipedia.org/wiki/Chmod#Octal_modes :-)

lambdaq commented 7 years ago

@beardypig You are correct. Thanks!