mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: fileMonitor : monitor directory, not file
Some editors (emacs) rename file at startup to the backup version. Hence watching the original file tells one nothing.
This commit is contained in:
@ -33,10 +33,6 @@ Note
|
||||
Compiling with FOAM_USE_STAT (or if /usr/include/sys/inotify.h
|
||||
does not exist) uses the stat function call.
|
||||
|
||||
- works fine except when a file is deleted and recreated:
|
||||
it stops monitoring the file!
|
||||
(does work though if the file gets moved)
|
||||
|
||||
SourceFiles
|
||||
fileMonitor.C
|
||||
|
||||
@ -46,9 +42,9 @@ SourceFiles
|
||||
#define fileMonitor_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "Map.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "className.H"
|
||||
#include "DynamicList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -83,13 +79,16 @@ private:
|
||||
// Private data
|
||||
|
||||
//- State for all watchFds
|
||||
mutable Map<fileState> state_;
|
||||
mutable DynamicList<fileState> state_;
|
||||
|
||||
//- From watch descriptor to filename
|
||||
HashTable<fileName, label> watchFile_;
|
||||
//- Filename for all watchFds
|
||||
DynamicList<fileName> watchFile_;
|
||||
|
||||
//- Free watchFds
|
||||
DynamicList<label> freeWatchFds_;
|
||||
|
||||
//- Watch mechanism (stat or inotify)
|
||||
mutable fileMonitorWatcher *watcher_;
|
||||
mutable autoPtr<fileMonitorWatcher> watcher_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
Reference in New Issue
Block a user