I am working on a Windows VC++ 2008 project, and trying to use fileIO to put stuff out in log files in a sub-directory. I am doing the following:
void MessageQueue::LogOut(thingEnum _thing){
std::ofstream Output;
Output.open("Output/MainLog.txt", std::ios::app);
if (Output.is_open()){
// writing stuff
}
Output.close();
}
I know that the ios::app will generate a file, but isn't it also able to generate folders as well, or do I need a different command to generate a folder for the files to exist in. when I get rid of the sub-directory in the code it works fine, and if I create the folder I can put the sub-directory code back.
note: I understand that I should technically open the file buffer the same line that I create the stream object. I did not because I plan to put the .open into a case switch (_thing) to have access to multiple files, and just change the stream.