Public Member Functions | Public Attributes | List of all members
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)
 

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< 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 ( const bool  useInotify,
const label  sz = 20 
)
inline

Initialise inotify.

Definition at line 134 of file fileMonitor.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, DynamicList< T, SizeInc, SizeMult, SizeDiv >::setCapacity(), and WarningIn.

Here is the call graph for this function:

~fileMonitorWatcher ( )
inline

Remove all watches.

Definition at line 183 of file fileMonitor.C.

References Foam::endl(), forAll, and WarningIn.

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 204 of file fileMonitor.C.

References Foam::abort(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::isDir(), Foam::lastModified(), fileName::name(), fileName::path(), and List< T >::size().

Here is the call graph for this function:

bool removeWatch ( const label  watchFd)
inline

Definition at line 270 of file fileMonitor.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, regIOobject::fileModificationSkew, forAll, Foam::lastModified(), oldTime(), and Foam::read().

Here is the call graph for this function:

Member Data Documentation

const bool useInotify_

Definition at line 115 of file fileMonitor.C.

int inotifyFd_

File descriptor for the inotify instance.

Definition at line 120 of file fileMonitor.C.

DynamicList<label> dirWatches_

Current watchIDs and corresponding directory id.

Definition at line 123 of file fileMonitor.C.

DynamicList<fileName> dirFiles_

Definition at line 124 of file fileMonitor.C.

DynamicList<time_t> lastMod_

From watch descriptor to modified time.

Definition at line 129 of file fileMonitor.C.


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