sub getNewestFile { my $dir=shift; my @files=glob "$dir/*"; my %mtimes; map { $mtimes{$_}=(stat $_)[9] } @files; @files=sort { $mtimes{$b}<=>$mtimes{$a} } keys %mtimes; $files[0]; }
See what you think, burden on your system should be minimal if you do it less than once every second.
HTH,
SSF
In reply to Re: Efficient multiplatform directory polling
by sflitman
in thread Efficient multiplatform directory polling
by rastoboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |