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

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -