At what times are files updated on windows

泄露秘密 提交于 2019-12-11 02:28:00

问题


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?

来源:https://stackoverflow.com/questions/25128966/at-what-times-are-files-updated-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!