That type of functionality is more down to the program accessing the file than the operating system. Most sensibly written programs will lock a file when it is opened for write access and prevent anyone else opening the file for write. If the program you are using does not do that, then you need to look at some way of helping the program with a batch file or similar.