On 07.03.15 20:21, Neil Girdhar wrote: > Why do you need ~ at all? Do any API calls that you want to make want > the inverted flags? Isn't the only point of inverting the bits in order > to clear a field? Because existing code uses it. mode = os.stat(path).st_mode os.chmod(path, mode & ~(stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH))