I have a directory on a pc that is watched by a FileSystemWatcher, images that are created with a wireless camera and copied across to the directory. The issue I am having is I need to process the image as soon as it is created, but sometimes the camera software still has a lock on the file and there does not seem to be a way of checking to see if a file is open/writable without first trying to open it, then reacting if it throws an exception.
Another bad practice I am using is a Thread.Sleep() after the exception is thrown, to pause a little longer so the lock on the image is released by the camera software. Ultimately I need to be able to deal with numerous cameras, and I cannot always guarantee that they don't have dodgy software, so an ability to check to see if a file is locked without having to throw an exception would eradicate the way the code is written at present?
I am willing to use C++ and creating a wrapper need be.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.