hello
using the perl fragment as published on the SGI::FAM CPAN module home:
use SGI::FAM;
my $fam=new SGI::FAM;
$fam->monitor('/foo');
$fam->monitor('/foo/bar.txt');
while (1) {
my $event=$fam->next_event; # Blocks
print "Pathname: ", $event->filename,
" Event: ", $event->type, "\n";
}
when I monitor most files, and then as a test say open them in vi and
issue a write command (:w) the script reports two 'change' events.
But with some files I get consistently 32 'change' events reported. I
thought initially it was related to the file size, but tests on
similarly sized files do not reflect this.
Is anyone able to explain why I would get multiple events reported on
some files and not on the others - the vast majority of files tested
report two events.
My needs are simple and I could easily work around the multiple events
(only need to know about one), but if I could solve the number of
reported events it would be better.
thanks
rolf.
|