my $path = "dir/file_to_watch"; my $prev_size = -s $path; while (1) { sleep 5; my $size_now = -s $path; if ( $size_now > $prev_size ){ print "file grew as of ".scalar localtime().$/; $prev_size = $size_now; } }
In reply to Re: detecting file changes
by graff
in thread detecting file changes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |