Indeed! This seems to get the job done and it provides an excellent spring board for
diving into the Win32API module. Thanks Billy! lol. Now, I'll be reading perldocs
and the like instead of testing software ;)
Kindest regards,
Carlos
Billy Conn wrote:
I'd try the following:
#!/usr/bin/perl -w
use strict;
use File::Spec;
use POSIX qw(tmpnam);
use Win32API::File;
my $num = shift || 100000;
my (@tempfiles, @temphandles);
#impatience
$| = 1;
END {
map {CloseHandle $_ } @temphandles;
#hubris
map {unlink $_ } @tempfiles;
};
my $temp_dir = File::Spec->tmpdir();
while($num--)
{
#laziness
my $path = File::Spec->rel2abs(File::Spec->catfile($temp_dir,
tmpnam() ));
my $hObject= Win32API::File::createFile( $path, 'qrwtc' );
push @temphandles, $hObject;
push @tempfiles, $path;
print "object: $hObject :", $^E, "\n";
}
sleep(60);
I was able to open 100,000 filehandles with no problem, though that
unlink kinda acts weird. DeleteFile might work, but I figured this was
enough to start you in the right direction.
cabz wrote:
Hello!
--
Gilbert Ryle: "Can I help you?"
Student : "Perhaps. I'm looking for 'The Forest', but all I see are these damned
trees!"
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs