Re: File system change notifications

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Steve,

"Steve" <sredmyer@xxxxxxxxxx> wrote in message
news:48c098a0-29b9-4d3f-a6d6-b4afb4f75aef@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Thanks for the response. I did that search you mentioned and came
across a demo by Bryan Stafford at http://www.mvps.org/vbvision. His
demo works reasonably well. However it does have a one flaw (that I
have found so far any way) in that it does not handle the adding of
new files to the watched directory very well. It does see the change
but then looks into its array of files existing before the change and
does not find it so does not know what to do with it. I am trying to
figure out now how to modify his to recognize that it is a new file
and handle it appropriately. The problem I am having is that Brad's
code indicates that there are other situations(namely a double
notification for the same file) which might appear the same in the
logic as a new file. I obviously do not want to trigger my logic if
the notification is just a duplicate of a previous one so I must
figure out how the duplicates happen and how they can be distinguished
from a new file.


I had a brief look at that, and it doesn't seem right. He's using a timer,
and then basically asks for immediate change notifications one after the
other. Rather you should use WaitForMultipleObjects, but as I said earlier
that's problematic without multi-threading so you probably need to put that
in an activex.exe.
Also note although Brian uses a API based timer with a hidden window, that really does nothing substantial over the VB6 timer component. It's still the same thread.


Most newer implementations use ReadDirectoryChangesW, but that's windows XP
or later only, AFAIK.

.



Relevant Pages

  • Re: timer queue
    ... I did end up creating a hidden window that works ok. ... Invoke on a property does fail with "rpc not available" after the app is ... The problem comes in the timer callback. ...
    (microsoft.public.vc.atl)
  • Re: [PATCH] virtio_net: free transmit skbs in a timer
    ... enables interrupts and waits for notification that more ... to let TX packets "hang out" in the TX ring unreclaimed ... Add a timer to ensure that any time we queue new TX ... networking and depend on timely completion notification. ...
    (Linux-Kernel)
  • Re: Timer problem
    ... Andy Baker ... I'd use the notification system. ... My problem is that while the connection is active, I disable the timer ... The Connection class raises a 'completed' event ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: [take12 0/3] kevent: Generic event handling mechanism.
    ... Since this is the sixthevent notification system that's getting ... userspace API is right this time? ... Just looking at the proposed kevent API, it appears that the timer event ...
    (Linux-Kernel)
  • Re: Messages at form closing?
    ... I get what mean about notification, but at that point, the record's already ... Save command buttong, so I coded my own that updates to the degree I ... One one of the subforms is a command ... >> would create duplicate calues in the index, primary key, or relationship. ...
    (microsoft.public.access.modulesdaovba)