Stream question...
I have a log file being updated by a third party program... I am trying to figure out how to have my app. recognize that the log file has been edited or data has been appended to that log file. Sort of like a listen() for a file change. I looked through all the stuff in my book on file I/O and cannot seem to come up with any ideas. I assume there is something in the windows API for this... Any ideas would be helpful,
-- Warhorseii
Each file should have a timestamp indicating when they've last been modified. Check it. How to do that depends on what OS you're using.
I looked a little bit through MSDN, and found out about FindFirstChangeNotification.
You can use the function to monitor changes in your directory, and then use ReadDirectoryChanges to determine whether or not the file modified was your log file.
You can use the function to monitor changes in your directory, and then use ReadDirectoryChanges to determine whether or not the file modified was your log file.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement