I am writing a program to copy files from one location to another. I only want to copy the files that is not in writing mode. Here is the logic:
(1) If the file is not opened (by any application), copy it;
(2) If the file is opened (by any application) but not in writing mode, copy it;
(3) If the file is opened and is in saving/writing mode, don't copy it.
I put FileInfo.Open method in a TRY block and try to catch an exception to determine if the file is in Writing mode. But it does not work -- I am going to get an exception for both (2) and (3). In other word, I can not get info if a file is in writing mode.
Thank you in advance for giving me a help.