[Python-Dev] Missing POSIX functions: the list
Andrew M. Kuchling
akuchlin@mems-exchange.org
Thu, 9 Dec 1999 11:32:08 -0500 (EST)
After poking around in the O'Reilly POSIX book, here's a list of POSIX
functions that don't seem to be available in Python. Not all of them
seem worth supporting. Ironically, Greg Ward's daemonize() Perl
subroutine, which started me on this, doesn't actually seem to need
anything that Python doesn't have.
I'm looking for corrections to the list; are there other POSIX
functions I've missed, or are some of them actually in Python?
I think implementing most of these functions is straightforward, with
the exception of opendir/readdir/closedir.
Worth adding?
=============
opendir(), readdir(), closedir() --
most of their functionality is available through
os.listdir(), but it might be useful to have a direct
interface. Downside is that this would require a new
extension type for the C DIR struct. My (lazy) inclination
is to not bother.
Worth adding:
=============
abort() -- used in Py_FatalError(), but not accessible to Python code
ctermid(), ctermid_r() -- returns the terminal pathname
-- probably just add ctermid(), but use ctermid_r() for
thread-safety
fpathconf(fd, name) -- Get configuration limit for a file
-- would need constants from unistd.h
getlogin() -- returns user's login name
-- could do something similar with pwd.getpwuid( os.getuid() )[0], but
getlogin() apparently looks in utmp
getgroups(gidsetsize, grouplist) -- Gets supplementary group IDs
pathconf(path, name) -- Gets config variables for a path
-- would need constants from unistd.h
sysconf(int name) -- Gets system configuration information
-- would need constants from unistd.h
Not worth adding:
=================
clearerr() -- looks like fileobjects call clearerr() before raising errors
cuserid() -- returns user's login name
-- ORA book says "Do not use this function" -- removed in 1990 POSIX
difftime
-- seems only required in C "because no addition properties
are defined for time_t" (Solaris man page)
tmpfile(), tmpnam() -- Create temp file, generate temp filename
-- Similar functionality available in tempfile.py
mblen(), mbstowcs(), mbtowc(), wcstombs(), wctomb()
-- Multi-byte character functions:
-- Don't bother; wait for the Unicode type.
--
A.M. Kuchling http://starship.python.net/crew/amk/
I'm sorry I became abusive just now ... calling you worms... I was just
speaking relatively, you understand.
-- Dekko, in ZOT! #3