I have been monitoring files in a directory on the network. I had initially used FileWatcher to monitor them. I found that the files were being locked while using FileWatcher so I changed my implementation to use DirectoryInfo to watch for newly arrived and deleted files in the directory that I am watching. It seems while using DirectoryInfo also, the files in the watch directory are getting locked thereby preventing the files from being deleted by another application after downloading the files. My watch application is a windows service.
Could anybody tell me if they have faced issues and if they have, how you have been resolve it ?
Thanks,
Are you sure that whatever is creating/updating the files is done? If not, the file will be locked.