Loading...
Searching...
No Matches
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.
 ~fileMonitorWatcher ()
 Remove all watches.
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.
DynamicList< label > dirWatches_
 Current watchIDs and corresponding directory id.
DynamicList< fileNamedirFiles_
DynamicList< double > lastMod_
 From watch descriptor to modified time.

Detailed Description

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

Definition at line 110 of file fileMonitor.C.

Constructor & Destructor Documentation

◆ fileMonitorWatcher()

fileMonitorWatcher ( const bool useInotify,
const label sz = 20 )
inline

Initialise inotify.

Definition at line 141 of file fileMonitor.C.

References dirFiles_, dirWatches_, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, inotifyFd_, lastMod_, useInotify_, and WarningInFunction.

Here is the call graph for this function:

◆ ~fileMonitorWatcher()

~fileMonitorWatcher ( )
inline

Remove all watches.

Definition at line 192 of file fileMonitor.C.

References dirWatches_, Foam::endl(), forAll, inotifyFd_, 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

Definition at line 279 of file fileMonitor.C.

References dirWatches_, inotifyFd_, lastMod_, and useInotify_.

Member Data Documentation

◆ useInotify_

const bool useInotify_

Definition at line 114 of file fileMonitor.C.

Referenced by addWatch(), fileMonitorWatcher(), removeWatch(), and ~fileMonitorWatcher().

◆ inotifyFd_

int inotifyFd_

File descriptor for the inotify instance.

Definition at line 121 of file fileMonitor.C.

Referenced by addWatch(), fileMonitorWatcher(), removeWatch(), and ~fileMonitorWatcher().

◆ dirWatches_

DynamicList<label> dirWatches_

Current watchIDs and corresponding directory id.

Definition at line 126 of file fileMonitor.C.

Referenced by addWatch(), fileMonitorWatcher(), removeWatch(), and ~fileMonitorWatcher().

◆ dirFiles_

DynamicList<fileName> dirFiles_

Definition at line 127 of file fileMonitor.C.

Referenced by addWatch(), and fileMonitorWatcher().

◆ lastMod_

DynamicList<double> lastMod_

From watch descriptor to modified time.

Definition at line 134 of file fileMonitor.C.

Referenced by addWatch(), fileMonitorWatcher(), and removeWatch().


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