getting umask without changing it

Fredrik Lundh fredrik at pythonware.com
Fri Jun 16 05:48:26 EDT 2006


Faik Uygur wrote:

> Is there a python way of getting the current umask without changing it?
> os.umask changes it, and i dont want to use os.system("umask")

just call os.umask twice:

    current_mask = os.umask(0)
    os.umask(current_mask)

</F> 






More information about the Python-list mailing list