Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Close all open file descriptors

by mifflin (Curate)
on Jul 28, 2004 at 14:45 UTC ( [id://378052]=note: print w/replies, xml ) Need Help??


in reply to Close all open file descriptors

The module Proc::Daemon closes all file handles before it forks. Here's the code snippet from its Init function...
## Close open file descriptors foreach $i (0 .. OpenMax) { POSIX::close($i); }

Replies are listed 'Best First'.
Re^2: Close all open file descriptors
by belg4mit (Prior) on Jul 28, 2004 at 14:47 UTC
    Ewww! Okay so it works, and I have to admit I thought of that general idea too, but iterating over all possible descriptors? That's just inelegant. And POSIX is still so like, heavy, man.

    --
    I'm not belgian but I play one on TV.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://378052]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-25 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found