in reply to Getting the timestamp of a file
The above nods at the issue of race conditions; it ignores possible contention issues.my $old_time = (stat( $file ))[9]; while ( 1 ) { sleep $period_in_seconds; my $current_time = (stat($file))[9]; while ( $current_time != $old_time ) { $old_time = $current_time; print "file changed$/"; $current_time = (stat($file))[9]; } }
Be well,
rir
|
|---|