I often see in programs (such as visual studio) a prompt indicating that a file which you have open has been modified by another user and whether or not you want to reload it. How would you go about doing this?
I usually use CreateFile for windows programs to read/write files, but I usually close the handle immediately after either reading or writing. I'm guesssing that I might have to open the file with FILE_SHARE_READ and FILE_SHARE_WRITE and then hang on to the handle and somehow monitor it for changes(?). Or perhaps there one or more of the access flags has to be set? Maybe a thread to monitor the handle or file state?
Anyone ever done this?
--Will Duty
wduty@radicalfringe.com
I usually use CreateFile for windows programs to read/write files, but I usually close the handle immediately after either reading or writing. I'm guesssing that I might have to open the file with FILE_SHARE_READ and FILE_SHARE_WRITE and then hang on to the handle and somehow monitor it for changes(?). Or perhaps there one or more of the access flags has to be set? Maybe a thread to monitor the handle or file state?
Anyone ever done this?
--Will Duty
wduty@radicalfringe.com