How can I deny access to a file I open with fstream? I want to unable access to the file while I\'m reading/writing to it with fstream?
Expanding on the comment by Casebash:
To open a file in windows so that other processes cannot write to it use
file.rdbuf()->open(path, std::ios_base::app, _SH_DENYWR);
_SH_DENYRW will deny both read and write access