Internal tracking via stat(3p) or inotify(7) More...
Public Member Functions | |
fileMonitorWatcher (const bool useInotify, const label sz=20) | |
Initialise inotify. More... | |
~fileMonitorWatcher () | |
Remove all watches. More... | |
bool | addWatch (const label watchFd, const fileName &fName) |
bool | removeWatch (const label watchFd) |
Public Attributes | |
const bool | useInotify_ |
int | inotifyFd_ |
File descriptor for the inotify instance. More... | |
DynamicList< label > | dirWatches_ |
Current watchIDs and corresponding directory id. More... | |
DynamicList< fileName > | dirFiles_ |
DynamicList< double > | lastMod_ |
From watch descriptor to modified time. More... | |
Internal tracking via stat(3p) or inotify(7)
Definition at line 111 of file fileMonitor.C.
|
inline |
Initialise inotify.
Definition at line 134 of file fileMonitor.C.
References fileMonitorWatcher::dirFiles_, fileMonitorWatcher::dirWatches_, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, fileMonitorWatcher::inotifyFd_, fileMonitorWatcher::lastMod_, DynamicList< T, SizeInc, SizeMult, SizeDiv >::setCapacity(), fileMonitorWatcher::useInotify_, and WarningInFunction.
|
inline |
Remove all watches.
Definition at line 183 of file fileMonitor.C.
References fileMonitorWatcher::dirWatches_, Foam::endl(), forAll, fileMonitorWatcher::inotifyFd_, fileMonitorWatcher::useInotify_, and WarningInFunction.
Definition at line 204 of file fileMonitor.C.
References Foam::abort(), fileMonitorWatcher::dirFiles_, fileMonitorWatcher::dirWatches_, Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::highResLastModified(), fileMonitorWatcher::inotifyFd_, Foam::isDir(), fileMonitorWatcher::lastMod_, fileName::name(), fileName::path(), List< T >::size(), and fileMonitorWatcher::useInotify_.
|
inline |
Definition at line 270 of file fileMonitor.C.
References fileMonitorWatcher::dirWatches_, fileMonitorWatcher::inotifyFd_, fileMonitorWatcher::lastMod_, and fileMonitorWatcher::useInotify_.
const bool useInotify_ |
Definition at line 115 of file fileMonitor.C.
Referenced by fileMonitorWatcher::addWatch(), fileMonitorWatcher::fileMonitorWatcher(), fileMonitorWatcher::removeWatch(), and fileMonitorWatcher::~fileMonitorWatcher().
int inotifyFd_ |
File descriptor for the inotify instance.
Definition at line 120 of file fileMonitor.C.
Referenced by fileMonitorWatcher::addWatch(), fileMonitorWatcher::fileMonitorWatcher(), fileMonitorWatcher::removeWatch(), and fileMonitorWatcher::~fileMonitorWatcher().
DynamicList<label> dirWatches_ |
Current watchIDs and corresponding directory id.
Definition at line 123 of file fileMonitor.C.
Referenced by fileMonitorWatcher::addWatch(), fileMonitorWatcher::fileMonitorWatcher(), fileMonitorWatcher::removeWatch(), and fileMonitorWatcher::~fileMonitorWatcher().
DynamicList<fileName> dirFiles_ |
Definition at line 124 of file fileMonitor.C.
Referenced by fileMonitorWatcher::addWatch(), and fileMonitorWatcher::fileMonitorWatcher().
DynamicList<double> lastMod_ |
From watch descriptor to modified time.
Definition at line 129 of file fileMonitor.C.
Referenced by fileMonitorWatcher::addWatch(), fileMonitorWatcher::fileMonitorWatcher(), and fileMonitorWatcher::removeWatch().