in reply to perl and slow NFS
sub checkfile { my $file = shift; my $duration = shift || 10; my $pid = fork(); unless ($pid) { # this is run from child die "cannot access $file\n" unless -e $file; } else { # this is run from parent sleep $duration; if ( kill 0, $pid) { warn "$pid still running after $duration seconds!"; kill 9, $pid; return; } return 1 } }
|
|---|