JavaFAM is a simple JNI wrapper of the FAM (File Alteration Monitor)
library.
Note! FAM appears to be replaced by Gamin (atleast
on Linux). However Gamin is FAM compatible, so this JNI wrapper
will work with Gamin aswell.
In order to build JavaFAM, FAM or Gamin must be installed (including
any development package).
Ant is used for
compiling JavaFAM, simply change to the
java-fam-<version> directory and type
ant.
As JavaFAM is a simple JNI wrapper of the FAM API, I refer you to the
existing FAM/Gamin documentation, see Links
section below.
A directory monitor example is included in the
src/examples directory. Run
./run-example.sh <directory> to monitor a directory,
ex.:
# ./run-example.sh . Enter 'q' to Quit Received event: FAMEvent[filename=.../java-fam; code=8] Received event: FAMEvent[filename=build; code=8] Received event: FAMEvent[filename=run-example.sh; code=8] Received event: FAMEvent[filename=build.xml; code=8] Received event: FAMEvent[filename=version.properties; code=8] Received event: FAMEvent[filename=dist; code=8] Received event: FAMEvent[filename=build.properties; code=8] Received event: FAMEvent[filename=COPYING; code=8] Received event: FAMEvent[filename=src; code=8] Received event: FAMEvent[filename=.../java-fam; code=9]