Continuing the discussion from Check if file is occupied:
I’m getting an error message from the Read Range activity: The process cannot access the file XXX because it is being used by another process.
I would like to check whether the file is in use and have found the link to the TryCatch check
file.Open(FileMode.Open, FileAccess.Read, FileShare.None), but I don’t know where to put that setting. So far I have the following:
EDIT: I don’t want to KillProcess as I don’t manage the file so somebody could genuinely be editing it. The file is also located on the shared drive.
Ideally I would like to be able to check if it’s open and then decide to act upon it.
Any help would be much appreciated.