J
Jeff
Hi. I am supporting a Windows service that uses FileSystemWatcher to
monitor an inbound directory for new files. If the service is shutdown
and files are dropped to the inbound directory, those files are not
picked up by FileSystemWatcher at service startup.
This is a rare circumstance where the service will be down, but it does
happen occasionally during maintenance windows.
The solution to this problem that is in the code now is that a Timer
has been introduced to watch the directory as well. That forced the
addition of some thread mgmt (lock{}) so that both the timer and the
FileSystemWatcher (on separate threads) don't process the same file.
Is there a way to get FileSystemWatcher to pick files up at startup?
I'd love to bag the Timer (it's always a special feeling ditching
code).
Thanks,
Jeff
monitor an inbound directory for new files. If the service is shutdown
and files are dropped to the inbound directory, those files are not
picked up by FileSystemWatcher at service startup.
This is a rare circumstance where the service will be down, but it does
happen occasionally during maintenance windows.
The solution to this problem that is in the code now is that a Timer
has been introduced to watch the directory as well. That forced the
addition of some thread mgmt (lock{}) so that both the timer and the
FileSystemWatcher (on separate threads) don't process the same file.
Is there a way to get FileSystemWatcher to pick files up at startup?
I'd love to bag the Timer (it's always a special feeling ditching
code).
Thanks,
Jeff