STINNER Victor <victor.stin...@haypocalc.com> added the comment: As written by Charles-Francois Natali (msg129890), we can use closefrom(). Pseudo-code: find the biggest fd than that be kept open, call closefrom(highest+1), and then use close() (os.closerange) for fd in 0..highest that have to be closed.
closefrom() is available on OpenBSD, Solaris and NetBSD. I don't know for FreeBSD: http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2007-07/msg00035.html On Linux, we can use os.listdir("/proc/self/fd") to get the list of open files. ---------- nosy: +haypo _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11284> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com