2010/2/20 Torsten Förtsch <torsten.foert...@gmx.net> [ ... ] > - is there a portable way to get all open file descriptors of the current > process? Under Linux one can readdir(/proc/self/fd). On Darwin I once > simply > closed all fds from 0 to 1000. Some systems have getdtablesize(2), > sometimes > it is getrlimit. Sometimes you can open /dev/something or > /proc/self/something > and read the descriptor table at a certain offset. What the module should > do > on Windows I simply don't know. >
I think just closing stdin and stdout is likely to be enough, or maybe all file descriptors from 0 to $^F . The OS will close any others that have the close-on-exec bit set, and the close-on-exec bit is set by default by Perl's open function. Anybody setting this to something different probably understands the consequences. ----Scott.