|The stupid question is the question not asked|
Re: How to close all open file descriptors after a fork?by jasonk (Parson)
|on Jul 19, 2005 at 14:04 UTC||Need Help??|
In addition to the method you've tried here, the FAQ also provides documentation on closing a filehandle using the syscall directly.
The method you tried didn't work for me either (which makes me wonder why it's in the FAQ), but this one did. Here is the test script I used: