I have a slight problem. I have a project that I'm working on and that requires two programs to read/write into some .txt files.  
Python writes into one .txt file, C++ reads from it. C++ does what it needs to do and then writes its own information into another .txt file that Python has to read.  
What I want to know is how can I check with C++ if Python has closed the .txt file before opening the same file, as Python may still be writing stuff into it and vice versa?  
If you need any extra information about this conundrum, feel free to contact me.
You might consider having each "writer" process write its output to a temporary file, close the file, then rename it to the filename that the "reader" process is looking for.
If the file is present, then the respective reader process knows that it can read from it.
Has .txt file been closed?