spawnle & umask

Fredrik Lundh fredrik at pythonware.com
Thu Dec 8 06:17:25 EST 2005


Yves Glodt wrote:

> I tried something like this but the umask part does not work clearly...:
>
> newpid =
> os.spawnle(os.P_NOWAIT,'/usr/bin/touch','/usr/bin/touch','xyz','umask 0113')
>
> What would be the correct syntax for setting the umask for the created
> process...?

not sure, but something like

    try:
        old_mask = os.umask(0113)
        newpid = os.spawnle(...)
    finally:
        os.umask(old_mask) # restore

might work.

</F> 






More information about the Python-list mailing list