How to get a std::iostream from a file by opening it with share locking on Windows? -
i looking simple solution open file, using createfile , being sure nobody can read/write , still being able obtain std::iostream object, needed later.
i think can following:
#include <iostream> #include <fstream> fstream my_stream; my_stream.open("my.file", std::ios_base::in | std::ios_base::out, _sh_denyrw); my_stream << "test";
Comments
Post a Comment