class _FDDetector: (source)
Method | __init__ |
Undocumented |
Instance Variable | getpid |
The implementation of getpid to use, returns the PID of the running process. |
Instance Variable | listdir |
The implementation of listdir to use. This gets overwritten by the test cases. |
Instance Variable | openfile |
The implementation of open() to use, by default the Python builtin. |
Method | _devFDImplementation |
Simple implementation for systems where /dev/fd actually works. See: http://www.freebsd.org/cgi/man.cgi?fdescfs |
Method | _fallbackFDImplementation |
Fallback implementation where either the resource module can inform us about the upper bound of how many FDs to expect, or where we just guess a constant maximum if there is no resource module. |
Method | _getImplementation |
Pick a method which gives correct results for _listOpenFDs in this runtime environment. |
Method | _listOpenFDs |
Return an iterable of file descriptors which may be open in this process. |
Method | _procFDImplementation |
Simple implementation for systems where /proc/pid/fd exists (we assume it works). |
Instance Variable | _implementations |
Undocumented |
Fallback implementation where either the resource module can inform us about the upper bound of how many FDs to expect, or where we just guess a constant maximum if there is no resource module.
All possible file descriptors from 0 to that upper bound are returned with no attempt to exclude invalid file descriptor values.
Pick a method which gives correct results for _listOpenFDs in this runtime environment.
This involves a lot of very platform-specific checks, some of which may be relatively expensive. Therefore the returned method should be saved and re-used, rather than always calling this method to determine what it is.
See the implementation for the details of how a method is selected.
Return an iterable of file descriptors which may be open in this process.
This will try to return the fewest possible descriptors without missing any.