Hello! I am new perl (again).
I am performing QA on software developed at my company. My task is to try to exhaust all file handles on the Win32 platform (Win2K and WinXP) and see how our software behaves. With the code below, I am able to open no more than 2045 file handles under a cmd.exe shell and 3197 under a Cygwin shell.
Regards, Carlos #!/usr/bin/perl -w if([EMAIL PROTECTED]) { print "usage: filehandles <integer> \n"; exit; } $totalfhs = shift; #I could use $ARGV[0]; $i = 1; while ($i == $totalfhs || $i < $totalfhs) { open $ar[$i], ">_$i.tmp" or die "Could not open $i"; $i++; } print $i-1 ." filehandles are open, hit any key to close \n"; $_ = <STDIN>; $i--; #cheesy but it is what is needed here while ($i > 0) { close($ar[$i]) or die "\n\nError closing: $!"; unlink("_$i.tmp") or die "\n\nError deleting: $!"; $i--; } _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs