os.fchown, avoiding a race condition

Martin v. Loewis martin at v.loewis.de
Wed Mar 27 14:35:27 EST 2002


jimd at vega.starshine.org (Jim Dennis) writes:

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

There are already a number of f* functions exposed in posixmodule.c
(fstat, ftruncate, fsync, fdatasync, fstatvfs, fpathconf); a patch
adding fchown would certainly be accepted. 

If you want polymorphism, you need to come up with a way of doing it
uniformly; that would require a PEP, documentation changes, and
testsuite additions (fchown would also require documentation changes).

Regards,
Martin



More information about the Python-list mailing list