fileMonitorWatcher Class Reference

Internal tracking via stat(3p) or inotify(7) More...

Collaboration diagram for fileMonitorWatcher:

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< labeldirWatches_
 Current watchIDs and corresponding directory id. More...
 
DynamicList< fileNamedirFiles_
 
DynamicList< double > lastMod_
 From watch descriptor to modified time. More...
 

Detailed Description

Internal tracking via stat(3p) or inotify(7)

Definition at line 111 of file fileMonitor.C.

Constructor & Destructor Documentation

◆ fileMonitorWatcher()

◆ ~fileMonitorWatcher()

~fileMonitorWatcher ( )
inline

Remove all watches.

Definition at line 183 of file fileMonitor.C.

References fileMonitorWatcher::dirWatches_, Foam::endl(), forAll, fileMonitorWatcher::inotifyFd_, fileMonitorWatcher::useInotify_, and WarningInFunction.

Here is the call graph for this function:

Member Function Documentation

◆ addWatch()

◆ removeWatch()

bool removeWatch ( const label  watchFd)
inline

Member Data Documentation

◆ useInotify_

◆ inotifyFd_

int inotifyFd_

◆ dirWatches_

DynamicList<label> dirWatches_

◆ dirFiles_

◆ lastMod_

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().


The documentation for this class was generated from the following file: