Fawkes API
Fawkes Development Version
|
23 #ifndef _UTILS_SYSTEM_FAM_H_
24 #define _UTILS_SYSTEM_FAM_H_
26 #include <core/utils/lock_list.h>
27 #include <sys/types.h>
67 virtual void fam_event(
const char *filename,
unsigned int mask) = 0;
95 size_t inotify_bufsize_;
97 std::map<int, std::string> inotify_watches_;
98 std::map<int, std::string>::iterator inotify_wit_;
void remove_listener(FamListener *listener)
Remove a listener.
static const unsigned int FAM_ATTRIB
Metadata changed.
virtual ~FamListener()
Virtual empty destructor.
static const unsigned int FAM_DELETE
Subfile was deleted.
~FileAlterationMonitor()
Destructor.
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_CLOSE_WRITE
Writtable file was closed.
static const unsigned int FAM_CLOSE
Close.
static const unsigned int FAM_ONESHOT
Only send event once.
void add_filter(const char *regex)
Add a filter.
static const unsigned int FAM_ACCESS
File was accessed.
static const unsigned int FAM_IGNORED
File was ignored.
void watch_file(const char *filepath)
Watch a file.
static const unsigned int FAM_MASK_ADD
Add to the mask of an already existing watch.
void add_listener(FamListener *listener)
Add a listener.
static const unsigned int FAM_ISDIR
Event occurred against dir.
void reset()
Remove all currently active watches.
void process_events(int timeout=0)
Process events.
void watch_dir(const char *dirpath)
Watch a directory.
void interrupt()
Interrupt a running process_events().
static const unsigned int FAM_DELETE_SELF
Self was deleted.
static const unsigned int FAM_MOVE
Moves.
static const unsigned int FAM_MODIFY
File was modified.
static const unsigned int FAM_MOVE_SELF
Self was moved.
static const unsigned int FAM_OPEN
File was opened.
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_DONT_FOLLOW
Do not follow a sym link.
static const unsigned int FAM_ALL_EVENTS
All events which a program can wait on.
static const unsigned int FAM_UNMOUNT
Backing fs was unmounted.
static const unsigned int FAM_CREATE
Subfile was created.
static const unsigned int FAM_CLOSE_NOWRITE
Unwrittable file closed.
virtual void fam_event(const char *filename, unsigned int mask)=0