In my project i have to access a *.txt file from two different programs. So, i want if one program is accessing the file then the other should wait ie both program should not access the file at same time.So, is there any way to know whether that file is being used by some other process or not.i m using vc++ under windows.

Ankush Gupta[/quote]