title: How can I tell if a file's been renamed?
body: <p>I'm updating some legacy code to more efficiently use <code>.ini</code> files for parameter storage. Basically, it caches all the settings internally once they're read so that they can be read again without opening the file. Before using the cache, I compare the cache creation time to the last modified time of the file, and recreate the cache with the updated file. This works great, except when users rename files, because that action doesn't update the last modified time.</p>
  
  <p>So if I copy my <code>app.ini</code> to <code>app - copy.ini</code>, modify <code>app - copy.ini</code> outside of my program, then delete <code>app.ini</code> and rename the copy to <code>app.ini</code>, my program is now using an outdated cache. Even if my program caught the deletion of <code>app.ini</code> and cleared the cache, it would not rebuild the cache when the copy was renamed. The program is designed to run for a very long time unattended, so I would like to avoid continually monitoring the file - only check it once I need to read a parameter.</p>