sub checkfile { my $file = shift; my $duration = shift || 10; eval { local $SIG{ALRM} = sub { die "file access to $file failed\n" }; alarm $duration; do { eval { die "cannot access $file\n" unless -e $file; }; sleep 1 if $@; } until !$@; alarm 0; }; return if $@; return 1 unless $@; }
In reply to perl and slow NFS by tmalyib
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |