Fstream open file in std::fstream::in | std::fstream::out | std::fstream::app mode
问题 I need to be able to create a non-existent file. The design is as follows : I have 1 thread for all file IO, and in the data structure that encapsulates the file, I have a std::fstream file_handle. Can I create and open this file in the mode - std::fstream::in | std::fstream::out | std::fstream::app ? I need this because I have to use this one handle to do both - reads, and writes to the end of the file. However this is not creating the file. Here's what I have : class file_io { std::string