Seastar
High performance C++ framework for concurrent servers
|
Filesystem modification notifier.
This is a thin wrapper around inotify(see http://man7.org/linux/man-pages/man7/inotify.7.html), which is the de-facto light-weight filesystem modification watch interface in Linux and can be used to log filesystem activities, reload configurations, etc.
The wrapper provides a buffered read of events, and RAII handling of watches themselves.
#include <seastar/core/fsnotify.hh>
Classes | |
struct | event |
A wrapper around inotify_event. More... | |
class | watch |
Simple RAII wrapper around a fsnotifier::watch_token. More... | |
Public Types | |
enum class | flags : uint32_t { access = IN_ACCESS , attrib = IN_ATTRIB , close_write = IN_CLOSE_WRITE , close_nowrite = IN_CLOSE_NOWRITE , create_child = IN_CREATE , delete_child = IN_DELETE , delete_self = IN_DELETE_SELF , modify = IN_MODIFY , move_self = IN_MOVE_SELF , move_from = IN_MOVED_FROM , move_to = IN_MOVED_TO , open = IN_OPEN , close = IN_CLOSE , move = IN_MOVE , oneshot = IN_ONESHOT , ignored = IN_IGNORED , onlydir = IN_ONLYDIR } |
Flags of events supported by FileSystem Notifier. More... | |
using | watch_token = int32_t |
Token of a watch point. | |
using | sequence_no = uint32_t |
Unique sequence number of associating related events. More... | |
Public Member Functions | |
fsnotifier (fsnotifier &&) | |
fsnotifier & | operator= (fsnotifier &&) |
future< watch > | create_watch (const sstring &path, flags mask) |
Monitor events specified in mask for the give path. More... | |
future< std::vector< event > > | wait () const |
void | shutdown () |
bool | active () const |
Check if the notifier is activated. | |
operator bool () const | |
Equivalent to active(). | |
struct seastar::experimental::fsnotifier::event |
Class Members | ||
---|---|---|
watch_token | id | |
flags | mask | |
sstring | name | |
sequence_no | seq |
using seastar::experimental::fsnotifier::sequence_no = uint32_t |
Unique sequence number of associating related events.
|
strong |
Flags of events supported by FileSystem Notifier.
future< watch > seastar::experimental::fsnotifier::create_watch | ( | const sstring & | path, |
flags | mask | ||
) |
Monitor events specified in mask for the give path.
path | path of the file or directory to monitor for. |
mask | events of interest. |
void seastar::experimental::fsnotifier::shutdown | ( | ) |
Shutdown the notifier and abort any waiting events.
Wait for events.