Timeout problem

Timeout problem

am 30.07.2010 00:40:36 von Barry Brevik

Environment: Active Perl v5.8.8 running on Windows XP and Windows Server
2003.

Application: My program periodically polls a specific directory
looking for files to process. The target directory
is a Samba share on a Redhat Linux server.

Problem: Sometimes (surprisingly often) the share "goes away", so I
coded a simple directory validation which is run each time before my
program polls the directory. If the share has evaporated, my program
hangs on a timeout that is in excess of 5 minutes. I need to have my
program recover right away- I can not wait for a 5 minute timeout.

Below, I have reproduced my test program which will reproduce the
problem (if the share has gone away). Note that if the share simply does
not exist, the code returns an error immediately. Only if the share
exists, but is not reachable does the 5 minute timeout happen.

Any timeout tips for me?


use warnings;
use strict;

my $folder = '//stellarora1/label';
print "About to test for the existence of folder: $folder.\n\n";

if (-e $folder)
{
print "folder exists.\n";

if (-d $folder)
{
print "folder is actually a folder.\n";
}
else
{
print "folder is actually a file.\n";
}
}
else
{
print "folder does not exist.\n";
}


-Barry Brevik
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs