Use int(x,8) for file permissions