in reply to Too many open files error on windows
Is it possible that the error is related to something else?
No.
By default, Perl can open 2048 files concurrently. Excluding the 3 standard files (stdin,stdout,stderr) that leaves 2045 for program use:
perl -E"say(),open $fh[$_], '>', qq[file$_] or die $! for 1 .. 1e5" 1 2 3 ... 2040 2041 2042 2043 2044 2045 2046 Too many open files at -e line 1.
Any tips on how to debug this?
You could modify all the open and close lines something like this:
open $fh, .... or die ...; close $fh;
To
open $fh, ... and printf( LOG "%s(%u) opening %u\n", __FILE__, __LINE_ +_, fileno( $fh ) ) or die ...; printf( LOG "%s(%u) closing %u\n", __FILE__, __LINE__, fileno( $fh ) ) + and close $fh;
Once the program fails it should be simple to find which opens do not have or are not reaching their associated close statements.
|
|---|