in reply to Reopen file when contents changed?
For example:
my @base = stat($FILE); my $base = "@base[0,1,10]"; # dev/ino/ctime while (1) { ... read $FILE here, and process it ... while (1) { my @new = stat($FILE); my $new = "@new[0,1,10]"; # current dev/ino/ctime if ($base ne $new) { # changed $base = $new; # reset last; # restart outer loop } sleep 1; # delay because no change } }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|