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 110 of file fileMonitor.C.
|
inline |
Initialise inotify.
Definition at line 141 of file fileMonitor.C.
References fileMonitorWatcher::dirFiles_, fileMonitorWatcher::dirWatches_, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, fileMonitorWatcher::inotifyFd_, fileMonitorWatcher::lastMod_, DynamicList< T, SizeMin >::setCapacity(), fileMonitorWatcher::useInotify_, and WarningInFunction.
|
inline |
Remove all watches.
Definition at line 192 of file fileMonitor.C.
References fileMonitorWatcher::dirWatches_, Foam::endl(), forAll, fileMonitorWatcher::inotifyFd_, fileMonitorWatcher::useInotify_, and WarningInFunction.
|
inline |
Definition at line 213 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(), UList< T >::size(), and fileMonitorWatcher::useInotify_.
|
inline |
Definition at line 279 of file fileMonitor.C.
References fileMonitorWatcher::dirWatches_, fileMonitorWatcher::inotifyFd_, fileMonitorWatcher::lastMod_, and fileMonitorWatcher::useInotify_.
const bool useInotify_ |
Definition at line 114 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 121 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 126 of file fileMonitor.C.
Referenced by fileMonitorWatcher::addWatch(), fileMonitorWatcher::fileMonitorWatcher(), fileMonitorWatcher::removeWatch(), and fileMonitorWatcher::~fileMonitorWatcher().
DynamicList<fileName> dirFiles_ |
Definition at line 127 of file fileMonitor.C.
Referenced by fileMonitorWatcher::addWatch(), and fileMonitorWatcher::fileMonitorWatcher().
DynamicList<double> lastMod_ |
From watch descriptor to modified time.
Definition at line 134 of file fileMonitor.C.
Referenced by fileMonitorWatcher::addWatch(), fileMonitorWatcher::fileMonitorWatcher(), and fileMonitorWatcher::removeWatch().