简体   繁体   中英

get file changes when FileWatcher does not fire

I have aa program (matrkion Data Manager to be exact) that write to a log file up to s curtain size then begins overwriting the log from the beginning. Not exactly ideal for debugging and event logging. So I am trying to write a C# program to establish a FileWatcher object so when the log is written to I can get the changes and save them off. This way I can see the entire log contents. The issue is the FileWatcher Change event is never thrown so can know when the log is changed. The only thing that is thrown is a FileSizeChange flag when the log is not filled, which it is always filled. Is there another way I can go about this?

I am going to go ahead and use a timer to poll the log every x seconds. Not efficient but it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM