I flush the ofstream after writing to it, and need to update to the actual file and launcher an external program to open it, and I need to keep the ofstream open without closing it. I did:
ofstream f("..", std::ofstream::out | std::ofstream::app | std::ofstream::trunc);
f << data << std::endl;
f.flush();
But the file does not even exists when the external program executes. The same problem here. How can I block the program till the file actually exists in the file system?