Re: Program to scan for changes in directory?

From: monica (monica_at_discussions.microsoft.com)
Date: 12/21/04


Date: Tue, 21 Dec 2004 10:45:01 -0800

OOPS. Nevermind, I figured out where to change that option. Now I still need
to figure out how to get the file name/file path of the changed item......

"monica" wrote:

> I went to that link and tried out the code myself. Excuse me if I seem to
> be asking dumb questions, but I'm sort of a "newbie" and found that the code
> as it's presented only checks one directory. If I have subdirectories in it,
> those get ignored if any changes are made in them. Is there a way to scan a
> directory for ALL subdirectories and do a type of "listening" for the entire
> group?
>
>
> "Tom Esh" wrote:
>
> > On Tue, 21 Dec 2004 08:25:05 -0800, monica
> > <monica@discussions.microsoft.com> wrote:
> >
> > > Our company is looking for a way to scan a directory, and all
> > >subdirectories, for any file changes and return the name (maybe path too) of
> > >that file. This needs to run continuously. Does anyone know of a program
> > >out there that does this, if not, do you have any code samples in VB6 that
> > >will do the same?
> >
> > There's an example of using the FindFirstChangeNotification Api
> > function on Randy Birch's site here:
> > http://vbnet.mvps.org/code/fileapi/watchedfolder.htm
> >
> > Note however that's only going to tell you ~when~ a change occurred
> > and the general type. If you need the filename(s) check out the
> > ReadDirectoryChangesW function. Don't know of an example for that one
> > offhand, but a Google search may turn up something. If not post back.
> >
> > -Tom
> > MVP - Visual Basic
> > (please post replies to the newsgroup)
> >