in reply to Counting open files?

How about something outside the script to save the file handles of all the files opened. Although I don't know if that would become locked. Best to close them when your done with them methinks, plus use some exception handling type stuff so that they get closed before your script dies.

How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
Robot Tourist, by Ten Benson

Replies are listed 'Best First'.
Re^2: Counting open files?
by Eyck (Priest) on Jun 22, 2005 at 12:40 UTC
    Generally, if you're not affraid of 'outside', you can use proc fs popular in many unices:
    opendir(D,"/proc/$$/fd/"); while ($fd=readdir(D)) { print "I've got this descriptor opened: $fd"; };
    and then, you could use BrowserUK's POSIX::close to close it;

    But this is not very portable, works on linux with procfs mounted, as soon as you move to win32, you're in trouble.

    I wanted something working from inside