23 #ifndef __UTILS_SYSTEM_FAM_H_ 24 #define __UTILS_SYSTEM_FAM_H_ 26 #include <core/utils/lock_list.h> 28 #include <sys/types.h> 68 virtual void fam_event(
const char *filename,
unsigned int mask) = 0;
96 size_t __inotify_bufsize;
98 std::map<int, std::string> __inotify_watches;
99 std::map<int, std::string>::iterator __inotify_wit;
102 bool __interruptible;
Fawkes library namespace.
void reset()
Remove all currently active watches.
static const unsigned int FAM_UNMOUNT
Backing fs was unmounted.
static const unsigned int FAM_ONESHOT
Only send event once.
void add_filter(const char *regex)
Add a filter.
static const unsigned int FAM_CREATE
Subfile was created.
void interrupt()
Interrupt a running process_events().
virtual void fam_event(const char *filename, unsigned int mask)=0
Event has been raised.
static const unsigned int FAM_ISDIR
Event occurred against dir.
static const unsigned int FAM_MOVE
Moves.
static const unsigned int FAM_OPEN
File was opened.
static const unsigned int FAM_ACCESS
File was accessed.
~FileAlterationMonitor()
Destructor.
static const unsigned int FAM_IGNORED
File was ignored.
static const unsigned int FAM_Q_OVERFLOW
Event queued overflowed.
static const unsigned int FAM_ONLYDIR
Only watch the path if it is a directory.
static const unsigned int FAM_MASK_ADD
Add to the mask of an already existing watch.
File Alteration Monitor Listener.
Monitors files for changes.
static const unsigned int FAM_MOVE_SELF
Self was moved.
static const unsigned int FAM_MOVED_FROM
File was moved from X.
FileAlterationMonitor()
Constructor.
static const unsigned int FAM_MOVED_TO
File was moved to Y.
static const unsigned int FAM_DELETE_SELF
Self was deleted.
void remove_listener(FamListener *listener)
Remove a listener.
static const unsigned int FAM_ALL_EVENTS
All events which a program can wait on.
void add_listener(FamListener *listener)
Add a listener.
static const unsigned int FAM_CLOSE_NOWRITE
Unwrittable file closed.
static const unsigned int FAM_DELETE
Subfile was deleted.
static const unsigned int FAM_MODIFY
File was modified.
void watch_dir(const char *dirpath)
Watch a directory.
void process_events(int timeout=0)
Process events.
static const unsigned int FAM_DONT_FOLLOW
Do not follow a sym link.
void watch_file(const char *filepath)
Watch a file.
static const unsigned int FAM_ATTRIB
Metadata changed.
virtual ~FamListener()
Virtual empty destructor.
static const unsigned int FAM_CLOSE_WRITE
Writtable file was closed.
static const unsigned int FAM_CLOSE
Close.