Waiting for a locked file

Jan 19 2006 12:15 PM
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)