current umask

Alex Martelli aleaxit at yahoo.com
Wed Oct 25 09:41:32 EDT 2000


"Emile van Sebille" <emile at fenx.com> wrote in message
news:8t6ks0$lt1ng$1 at ID-11957.news.cis.dfn.de...
> umask = os.popen('umask').read()[:-1]

Doesn't work on Windows (while os.umask() does), as
Windows doesn't have a popen-executable 'umask'.  I
suspect that
    umask=os.umask(0); os.umask(umask)
may be preferable (no portability-loss), although
it does mean there's a timewindow in which the wrong
umask would be used (only relevant on multithreaded
Python programms, I think).


Alex






More information about the Python-list mailing list