current umask

Stian Husemoen stianh at ifi.uio.no
Wed Oct 25 10:05:36 EDT 2000


Tino Lange wrote:
>how can I determine the "current" umask
>without touching it?

Since os.umask() returns the previous umask, you could do:

def getumask():
	umask = os.umask(0777)
	os.umask(umask)
	return umask

That will not get the umask without 'touching' it, but it will be left
unchanged.

-- 

Stian Husemoen <stianh>



More information about the Python-list mailing list