Re: File system change notifications
- From: "Bill McCarthy" <Bill@xxxxxxxxxxxxx>
- Date: Mon, 8 Dec 2008 13:46:26 +1100
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.
.
- References:
- File system change notifications
- From: Steve
- Re: File system change notifications
- From: Bill McCarthy
- Re: File system change notifications
- From: Steve
- File system change notifications
- Prev by Date: Re: File system change notifications
- Next by Date: Re: File system change notifications
- Previous by thread: Re: File system change notifications
- Next by thread: Re: File system change notifications
- Index(es):
Relevant Pages
|