Checking for changes to files. More...
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 fileName & | getFile (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< fileState > | fileStateNames_ |
Checking for changes to files.
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!!
Definition at line 62 of file fileMonitor.H.
enum fileState |
Enumerator | |
---|---|
UNMODIFIED | |
MODIFIED | |
DELETED |
Definition at line 69 of file fileMonitor.H.
|
explicit |
Definition at line 420 of file fileMonitor.C.
~fileMonitor | ( | ) |
Definition at line 433 of file fileMonitor.C.
ClassName | ( | "fileMonitor" | ) |
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.
bool removeWatch | ( | const label | watchFd | ) |
Definition at line 482 of file fileMonitor.C.
References Foam::expressions::patchExpr::debug, Foam::endl(), and Foam::Pout.
const Foam::fileName & getFile | ( | const label | watchFd | ) | const |
Definition at line 496 of file fileMonitor.C.
Foam::fileMonitor::fileState getState | ( | const label | watchFd | ) | const |
Definition at line 502 of file fileMonitor.C.
Definition at line 510 of file fileMonitor.C.
References Foam::expressions::patchExpr::debug, Foam::endl(), forAll, Pstream::listCombineGather(), Pstream::listCombineScatter(), UPstream::master(), Foam::Pout, Foam::reduce(), Pstream::scatter(), PackedList::set(), PackedList::storage(), and WarningInFunction.
void setUnmodified | ( | const label | watchFd | ) |
Definition at line 606 of file fileMonitor.C.
References Foam::highResLastModified().
|
static |
Definition at line 76 of file fileMonitor.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.