Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to know how to monitor changes in real time in a file in Windows. I've found other answers like using tail but this only works for log files or similar, where changes are made at the end of the file.

In my situation, I need to monitor changes in an XML file in real time. Actually I'm monitoring this file manually by:

  • Copy config.xml to config.backup
  • Make changes in the main program through the GUI (one at a time)
  • Compare config.backup with config.xml using WinMerge
  • Repeat the process

I would like to have something like RegFromApp that watches changes in the registry made by a process. I've tried ProcMon by it indicates that the file is changed but not the change made to it.

Any idea would be very appreciated.

Thanks.

share|improve this question
    
It is impossible (yes, I said that word) to do this if the file is opened for exclusive access by the program doing the updating. If it's open for shared access, all you can do is wait for the filesystem event that it was changed, and then re-read the entire contents of the file... but by the time you do, it might've been changed again, and there's no guarantee that you can trap each individual write on the monitoring side. –  allquixotic Nov 19 '12 at 21:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.