-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileWatcher.cpp
More file actions
25 lines (18 loc) · 810 Bytes
/
Copy pathFileWatcher.cpp
File metadata and controls
25 lines (18 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*******************************************************************************
* libunix++: C++ wrapper for Linux system calls
* inotify wrapper
*
* © 2026, Sauron <libunixpp@saur0n.science>
******************************************************************************/
#include "exception.hppi"
#include "FileWatcher.hpp"
using namespace upp;
/******************************************************************************/
FileWatcher::FileWatcher() : Stream(inotify_init()) {}
FileWatcher::FileWatcher(int flags) : Stream(inotify_init1(flags)) {}
unsigned FileWatcher::add(const char * path, uint32_t mask) {
NORMAL_FN_WRAPPER(inotify_add_watch(getDescriptor(), path, mask));
}
void FileWatcher::remove(unsigned wd) {
NORMAL_OP_WRAPPER(inotify_rm_watch(getDescriptor(), wd));
}