Public Types | Public Member Functions | Static Public Attributes | List of all members
fileMonitor Class Reference

Checking for changes to files. More...

Collaboration diagram for fileMonitor:
Collaboration graph
[legend]

Public Types

enum  fileState { UNMODIFIED = 0, MODIFIED = 1, DELETED = 2 }
 

Public Member Functions

 ClassName ("fileMonitor")
 
 fileMonitor (const bool useInotify)
 
 ~fileMonitor ()
 
label addWatch (const fileName &)
 
bool removeWatch (const label watchFd)
 
const fileNamegetFile (const label watchFd) const
 
fileState getState (const label watchFd) const
 
void updateStates (const bool masterOnly, const bool syncPar) const
 
void setUnmodified (const label watchFd)
 

Static Public Attributes

static const Enum< fileStatefileStateNames_
 

Detailed Description

Checking for changes to files.

Note
The default is to use stat to get the timestamp.

Compile with FOAM_USE_INOTIFY to use the inotify (Linux specific, since 2.6.13) framework. The problem is that inotify does not work on nfs3 mounted directories!!

Source files

Definition at line 62 of file fileMonitor.H.

Member Enumeration Documentation

◆ fileState

enum fileState
Enumerator
UNMODIFIED 
MODIFIED 
DELETED 

Definition at line 69 of file fileMonitor.H.

Constructor & Destructor Documentation

◆ fileMonitor()

fileMonitor ( const bool  useInotify)
explicit

Definition at line 420 of file fileMonitor.C.

◆ ~fileMonitor()

Definition at line 433 of file fileMonitor.C.

Member Function Documentation

◆ ClassName()

ClassName ( "fileMonitor"  )

◆ addWatch()

Foam::label addWatch ( const fileName fName)

Definition at line 441 of file fileMonitor.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), Foam::Pout, and WarningInFunction.

Here is the call graph for this function:

◆ removeWatch()

bool removeWatch ( const label  watchFd)

Definition at line 482 of file fileMonitor.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ getFile()

const Foam::fileName & getFile ( const label  watchFd) const

Definition at line 496 of file fileMonitor.C.

◆ getState()

Foam::fileMonitor::fileState getState ( const label  watchFd) const

Definition at line 502 of file fileMonitor.C.

◆ updateStates()

void updateStates ( const bool  masterOnly,
const bool  syncPar 
) const

◆ setUnmodified()

void setUnmodified ( const label  watchFd)

Definition at line 606 of file fileMonitor.C.

References Foam::highResLastModified().

Here is the call graph for this function:

Member Data Documentation

◆ fileStateNames_

const Foam::Enum< Foam::fileMonitor::fileState > fileStateNames_
static

Definition at line 76 of file fileMonitor.H.


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