• Advertisement
Sign in to follow this  

Reload externally modified files automatically?

This topic is 3233 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Basically, if I have a tool A that creates a file, and then another tool B that loads that file, and then tool A modifies that file, how can tool B be notified of this situation so it can respond to it under Windows? I'm not having good luck searching the net, I don't think I'm wording the problem correctly.

Share this post


Link to post
Share on other sites
Advertisement
Assuming both tools are yours, you won't be able to do this with two arbitrary programs, you can take a look at the following resources:
How to get the File/Directory change notifications? (C++/MFC)
Watching a File in C#

If those two aren't enough, then you just want to Google "File change notifications" along with whatever language or platform you are using for the specifics. Happy searching!

Share this post


Link to post
Share on other sites
Most applications that have this feature simply check the "Last Modified" timestamp of all the files they have open when they receive focus. In the vast majority of cases, that's "good" enough (because most of the time, you have to switch to Application B to modify the file, then when you switch back to Application A, it can detect when it gets the "received focus" message).

If you look at Visual Studio, for example, that's all it does - it only detects that the file has be modified when you give it focus.

Not sure if that'll work for you...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement