os.fchown, avoiding a race condition

Jim Dennis jimd at vega.starshine.org
Wed Mar 27 14:07:49 EST 2002


In article <a7s2kr$ds0$1 at knossos.btinternet.com>, John Leach wrote:

>Hi,

> I haven't managed to find any reference in python (any version) to the
> unix system call fchown (SVr4, SVID, POSIX, X/OPEN).  There is chown, but
> not fchown.

> I'd like to create a file as a different user but would like to avoid a
> race condition by chowning via the file descriptor, but it seems I cannot.

> Does anyone know why this seems to be missing?  Any plans for it to
> appear?  Any other way I can do this?

> Thanks in advance.

>-John.

	If would be cool if os.chown was overloaded to take
	*either* a patch *or* a file descriptor (from 
	file_instance.fileno()) as its first argument.

	Should that be submitted as a PEP and/or patch?




More information about the Python-list mailing list