Announcement

Collapse
No announcement yet.

monitoring a file for changes (createchangenotify?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • monitoring a file for changes (createchangenotify?)

    Does anybody have any examples of monitoring a single file for changes? From memory theres an API call called SomethingChangeNotify or thereabouts, Im sure somebody here has done it before but I couldnt find any links?


    ------------------
    -

  • #2
    The APIs you are after are
    FindFirstChangeNotification and FindNextChangeNotification.
    Also, if you need a responsive GUI you will need
    MsgWaitForMultipleObjects.

    There is a nice example of this in Advanced Windows by Jeffrey Richter
    in the chapter on file systems(FILECHNG.EXE).
    The new version of his book has a new name. I don't remember what it
    is at the moment.


    ------------------
    Dominic Mitchell
    Dominic Mitchell
    Phoenix Visual Designer
    http://www.phnxthunder.com

    Comment


    • #3
      Also, in the source code forum I posted an 'Internet Cookie Monitor" program which uses the File Notify stuff. It includes the code you need to figure out which file in a folder has changed.

      This was 4-6 weeks ago if you use the search. (Just search on "cookie" it should turn up).


      MCM
      Michael Mattias
      Tal Systems Inc. (retired)
      Racine WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        geez, i answered my own question in november 2000 but had completely forgotten about it, http://www.powerbasic.com/support/pb...ad.php?t=22834 - "monitor a directory to detect filesize change"
        dave, i think i need to join you on that vacation ...
        thanks for pointing me to that cookie monitor though michael, very cute little utility


        ------------------
        -

        Comment

        Working...
        X