I have a situation where I will have two different programs possibly trying to access/modify a single file at potentially the same time. There is no way around having two separate programs, so that is not debatable. Will I get some sort of error code in the program I am writing in C++ if it tries to open the file, and the other program is still using/modifying it? Can I create a loop that can read that error code, and keep trying to access it until the other program is done with it?