I have to concurrently run TCL and Python scripts which access the same files. I have decided to restrict each program so that they have exclusive write access to exactly one file. Each program has read access to all files (say two programs and two files). I don't care about dirty reads (ie reading a partially finished write). I just want to know what will happen in the following two cases:
a programs tries to open a file for writing when another program has it open for reading.
a program tries to open a file for reading while another program has it open for writing.
I guess I am concerned that the write will fail if the other program has the file open (even if it is only open in read mode). I am running in windows with a single Python thread and a TCL program called from Python on subprocess.