in reply to Re: Counting open files?
in thread Counting open files?

Have you ever used any libraries?

If you have, then how do you know what fds it opens? If you answer that, then you have answered my question.

Replies are listed 'Best First'.
Re^3: Counting open files?
by derby (Abbot) on Jun 22, 2005 at 14:38 UTC
    Hmmm ... what version of perl and what OS are you using? The normal behaviour for exec is to close all file descriptors from SYSTEM_MAX_FD+1 to however many you have open. I can envision only a few ways for this error to happen.
    • Your os does not support close-on-exec
    • the code has gone out of it's way to clear the close-on-exec flag
    • $^F was munged (SYSTEM_MAX_FD - normally set to 2 because you normally want stdin, stdout and stderr passed across exec)
    • the code is re-opening stdin, stdout, stderr without first closing them
    -derby
Re^3: Counting open files?
by mrborisguy (Hermit) on Jun 22, 2005 at 12:38 UTC

    Knowing what libraries you have are using would help us help you.

    Most well-written libraries that open files probably should have a method of closing those files as well.

        -Bryan