SledgeHammer_999
November 20th, 2007, 06:31 AM
I have a problem. When I use this code:
s = "//home//<username>//dd.txt";
settings.open(s.c_str(), std::ios::out);
if (settings.is_open()) settings << "works";
But if I use this, it doesn't work:
s = "//home//<username>//<new folder>//dd.txt";
settings.open(s.c_str(), std::ios::out);
if (settings.is_open()) settings << "works";
The difference is that I am trying to create the txt file in a new folder. I was hoping that fstream will automatically create the new folder but it doesn't. Can you tell me how do I create a new folder?
thank you in advance
s = "//home//<username>//dd.txt";
settings.open(s.c_str(), std::ios::out);
if (settings.is_open()) settings << "works";
But if I use this, it doesn't work:
s = "//home//<username>//<new folder>//dd.txt";
settings.open(s.c_str(), std::ios::out);
if (settings.is_open()) settings << "works";
The difference is that I am trying to create the txt file in a new folder. I was hoping that fstream will automatically create the new folder but it doesn't. Can you tell me how do I create a new folder?
thank you in advance