I'm using fam-2.6.8-4 on Red Hat Linux 8.0. When I monitor a directory,
FAM does not report an event when the directory is removed. The
following program can be used to demonstrate the problem.
#include <stdio.h>
#include <fam.h>
static const char *const fam_event_names[] =
{
NULL, "FAMChanged", "FAMDeleted", "FAMStartExecuting",
"FAMStopExecuting", "FAMCreated", "FAMMoved",
"FAMAcknowledge", "FAMExists", "FAMEndExist"
};
int main(int argc, char *argv[])
{
FAMConnection fc;
FAMRequest fr;
FAMEvent fe;
FAMOpen(&fc);
FAMMonitorDirectory(&fc, argv[1], &fr, NULL);
while (1) {
FAMNextEvent(&fc, &fe);
printf("%s: %s\n", fe.filename,
fam_event_names[fe.code]);
}
return 0;
}
Create a directory and run this program with the absolute path of the
directory as its parameter. It will report the FAMExists and
FAMEndExist events as expected, and it will report any changes to the
contents of the directory. If the directory is removed, however, it
will not be reported.
Is this a known behavior? If so, is there a workaround that's simpler
than monitoring the parent directory?
Thanks!
--
========================================================================
Ian Pilcher pilchman@xxxxxxxxx
========================================================================
|