Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


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

You must log in to answer this question.

Browse other questions tagged .