in reply to detecting file changes
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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: detecting file changes
by Anonymous Monk on Oct 14, 2006 at 18:58 UTC |