5
Answers

Waiting for a locked file

Juan Antonio 0

Juan Antonio 0

18y
6.5k
1
Hello!

   I have one program that modifies one file. After this program finalizes is started a .bat file for renaming the file that has been modified by the program. Some times I get the message "The process cannot access the file because it is being used by used by another program" The program that has modified the file has not free the file yet. I want to make another program in C# for waiting until the file be free but I didn't find any function within System.IO for doing this task. Is there any way to test this condition into C#?


Best regards
Answers (5)