How to close all files between fork and exec?

Russ Allbery rra at stanford.edu
Wed Jan 17 21:29:42 EST 2001


In comp.unix.programmer, Donn Cave <donn at u.washington.edu> writes:
> Quoth Harald Kirsch <kirschh at lionbioscience.com>:

>> On some systems there is a constant like OPEN_MAX but I read that on
>> recent Solaris versions there is no real limit to it.  How do I get
>> hold of the highest numbered open file descriptor, in particular in
>> python?

> Unfortunately it looks to me like no one has ever put getdtablesize()
> in Python.

That's probably because the more portable way to do this is to use either
sysconf(_SC_OPEN_MAX) or getrlimit(RLIMIT_NOFILE, &rl).

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>



More information about the Python-list mailing list