Nick
Tue Jul 22 22:05:06 CDT 2003
> is there any way to find out if and
> when a network directory that is initially available when
> the Path is assigned subsequently becomes invalid once
> the FileSystemWatcher is active and monitoring the
> directory?
I'm not sure if Windows even knows that the directory is no longer
available. WMI would be the most likely candidate for monitoring this type
of stuff, but the Win32_VolumeChangeEvent notes that "(monitoring of
n)etwork drives are not currently supported". Polling would probably be the
only option.
> Secondly, can anyone tell me how frequently the
> FileSystemWatcher will poll the directory it is watching
> and if there is any way to configure this?
It doesn't poll. The event-based ReadDirectoryChangesW function is used.
Nick Wienholt, MVP
Maximizing .NET Performance
http://www.apress.com/book/bookDisplay.html?bID=217
Sydney Deep .NET User Group www.sdnug.org
"Tim" <tim.carpenter@scottish-southern.co.uk> wrote in message
news:06f401c3505e$d84e3da0$a001280a@phx.gbl...
> I'm trying to use a FileSystemWatcher object to monitor
> changes to a network directory. I understand that if I
> try to assign an un-available directory to the Path
> property it will throw an exception to let me know the
> path is invalid. But is there any way to find out if and
> when a network directory that is initially available when
> the Path is assigned subsequently becomes invalid once
> the FileSystemWatcher is active and monitoring the
> directory?
> Secondly, can anyone tell me how frequently the
> FileSystemWatcher will poll the directory it is watching
> and if there is any way to configure this?