Message129891
| Author |
vstinner |
| Recipients |
loewis, neologix, s7v7nislands, vstinner |
| Date |
2011年03月02日.13:22:41 |
| SpamBayes Score |
0.02875343 |
| Marked as misclassified |
No |
| Message-id |
<1299072163.96.0.552296584699.issue11284@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年03月02日 13:22:44 | vstinner | set | recipients:
+ vstinner, loewis, s7v7nislands, neologix |
| 2011年03月02日 13:22:43 | vstinner | set | messageid: <1299072163.96.0.552296584699.issue11284@psf.upfronthosting.co.za> |
| 2011年03月02日 13:22:41 | vstinner | link | issue11284 messages |
| 2011年03月02日 13:22:41 | vstinner | create |
|