Public Member Functions | Data Fields
fileMonitorWatcher Class Reference

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

Collaboration diagram for fileMonitorWatcher:
Collaboration graph
[legend]

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)
 

Data Fields

const bool useInotify_
 
int inotifyFd_
 File descriptor for the inotify instance. More...
 
DynamicList< labeldirWatches_
 Current watchIDs and corresponding directory id. More...
 
DynamicList< fileNamedirFiles_
 
DynamicList< time_t > 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 ( const bool  useInotify,
const label  sz = 20 
)
inline

◆ ~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()

bool addWatch ( const label  watchFd,
const fileName fName 
)
inline

◆ removeWatch()

bool removeWatch ( const label  watchFd)
inline

Field Documentation

◆ useInotify_

const bool useInotify_

◆ inotifyFd_

int inotifyFd_

◆ dirWatches_

DynamicList<label> dirWatches_

◆ dirFiles_

DynamicList<fileName> dirFiles_

◆ lastMod_

DynamicList<time_t> 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: