I have added a watcher like this:
watcher = new FileSystemWatcher(LOGFILES, "*.log");
watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
| NotifyFilters.FileName;
// Add event handlers.
watcher.Changed += new FileSystemEventHandler(OnChanged);
watcher.Created += new FileSystemEventHandler(OnChanged);
watcher.Deleted += new FileSystemEventHandler(OnChanged);
watcher.Renamed += new RenamedEventHandler(OnRenamed);
// Begin watching.
watcher.EnableRaisingEvents = true;
and there is some external application writing to log files in the LOGFILES folder. But the watcher dont seem to trigger itself for hours, then when I remote desktop to the machine and manually opens the folder I can see for my self how a file 1sec later updates the size/timestamp.
Is there any chance that the external app writing the log files first are flushing when a user actually enters the folder or what can possible cause this?