Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. FindFirstChangeNotification

FindFirstChangeNotification

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminquestion
8 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Still learning how to code
    wrote on last edited by
    #1

    Is there an equivalent function to FindFirstChangeNotification that works across a home network ? :confused:

    Doug

    G 2 Replies Last reply
    0
    • S Still learning how to code

      Is there an equivalent function to FindFirstChangeNotification that works across a home network ? :confused:

      Doug

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      hmmmm - how do you mean

      DougButtimer wrote:

      across a home network

      In general, iirc, FindFirstChangeNotification can only be used on a local PC and cant even be used to watch net shares. Any time Ive needed to 'achieve similar' across a network Ive used ftp to list a directory at time-0 'initial snapshiot', then compared that to ftp lists at time+n where n is 'polled'/refreshed at desired intervals - eg 5 or 15 minutes sorry, likely doesnt help much 'g'

      S 1 Reply Last reply
      0
      • G Garth J Lancaster

        hmmmm - how do you mean

        DougButtimer wrote:

        across a home network

        In general, iirc, FindFirstChangeNotification can only be used on a local PC and cant even be used to watch net shares. Any time Ive needed to 'achieve similar' across a network Ive used ftp to list a directory at time-0 'initial snapshiot', then compared that to ftp lists at time+n where n is 'polled'/refreshed at desired intervals - eg 5 or 15 minutes sorry, likely doesnt help much 'g'

        S Offline
        S Offline
        Still learning how to code
        wrote on last edited by
        #3

        Hi Garth,   Just after I had made this posting, I realised that I'd hit this problem once before and hadn't found a solution then either, so your reply wasn't unexpected !   Yes, I think that I'll have to resort to some solution along your lines !   Thanks, and a very happy Christmas to you !

        Doug

        G 1 Reply Last reply
        0
        • S Still learning how to code

          Hi Garth,   Just after I had made this posting, I realised that I'd hit this problem once before and hadn't found a solution then either, so your reply wasn't unexpected !   Yes, I think that I'll have to resort to some solution along your lines !   Thanks, and a very happy Christmas to you !

          Doug

          G Offline
          G Offline
          Garth J Lancaster
          wrote on last edited by
          #4

          I thought of 2 possibilities 'a bit better' than comparing ftp listings Both really depend on how many files/events you are looking for - one might work for instance with creation of a particular file or a 'low volume' change system than the other - what about :- 1) use FindFirstChangeNotification on the machine you are watching, but add the [possibly filtered] events to a log file ... everytime you ftp from the 'monitoring machine', you grab the log file and erase it 2) use a tcp pub/sub system, the monitored machine publishes [again, possibly filtered] events from FindFirstChangeNotification to subscriber(s) - the monitor machine(s) 'subscribe' to particular events composing of {source machine name, add/change/delete, file(s)} for example - a lot more work, but extensible and applicable to multiple machines you might want to monitor from not much I know 'g'

          1 Reply Last reply
          0
          • S Still learning how to code

            Is there an equivalent function to FindFirstChangeNotification that works across a home network ? :confused:

            Doug

            G Offline
            G Offline
            Garth J Lancaster
            wrote on last edited by
            #5

            Im going to undo everything I just said - I just did some more reading - if you follow http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(VS.80).aspx[^] it says you can monitor UNC paths !!! 'g'

            S 1 Reply Last reply
            0
            • G Garth J Lancaster

              Im going to undo everything I just said - I just did some more reading - if you follow http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(VS.80).aspx[^] it says you can monitor UNC paths !!! 'g'

              S Offline
              S Offline
              Still learning how to code
              wrote on last edited by
              #6

              Garth, Unfortunately, being a novice, I'm not "in to" Net Framework !!   Thanks for your research, nevertheless

              Doug

              G 1 Reply Last reply
              0
              • S Still learning how to code

                Garth, Unfortunately, being a novice, I'm not "in to" Net Framework !!   Thanks for your research, nevertheless

                Doug

                G Offline
                G Offline
                Garth J Lancaster
                wrote on last edited by
                #7

                yes, but .NET uses ReadDirectoryChangesW - which if you look at this :- CDirectoryChangeWatcher - ReadDirectoryChangesW all wrapped up[^] shows how its possible to use it from c++ - and there are other examples 'out there' :-) 'g'

                S 1 Reply Last reply
                0
                • G Garth J Lancaster

                  yes, but .NET uses ReadDirectoryChangesW - which if you look at this :- CDirectoryChangeWatcher - ReadDirectoryChangesW all wrapped up[^] shows how its possible to use it from c++ - and there are other examples 'out there' :-) 'g'

                  S Offline
                  S Offline
                  Still learning how to code
                  wrote on last edited by
                  #8

                  Hi Garth,   I think that the real problem is that the folder that I want to watch is on a NAS disk and so the "This code will only work on Windows NT, Windows 2000, or Windows XP, and the directory you wish to watch must also reside on a WindowsNT, Windows 2000, or Windows XP computer" is going to make it a non-starter.   I've now implemented a polling _findfirst/_findnext strategy which, although a bit basic, works fine !!   (Just hope that the NAS disk can stand the traffic !!) Many thanks for your determination to find me a solution !!! Cheers !

                  Doug

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups