I need to setup an application that watches for files being created in a directory, both locally or on a network drive.
Would the FileSystemWatcher
or polling on a timer would be the best option. I have used both methods in the past, but not extensively.
What issues (performance, reliability etc.) are there with either method?
I have run into trouble using
FileSystemWatcher
on network shares. If you're in a pure Windows environment, it might not be an issue, but I was watching an NFS share and since NFS is stateless, there was never a notification when the file I was watching changed.