getting umask without changing it
Faik Uygur
faik at pardus.org.tr
Fri Jun 16 06:24:57 EDT 2006
Cuma 16 Haziran 2006 12:48 tarihinde, Fredrik Lundh şunları yazmıştı:
> 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)
This is not atomic. At this point i changed all the running python threads'
umask and i don't want to change current umask. I just want to get it.
> os.umask(current_mask)
- Faik
More information about the Python-list
mailing list