in this program it simply gets it's own containing directory and adds a data
folder if there isn't one already.
isn't there an easier way like directly concatenating the string to the pth object below? ( something like pth += "\\DataFiles"; but when I do that it only makes it \\DataFiles and therefore is in the root directory.)
namespace fs = std::experimental::filesystem;
int main()
{
string path;
fs::path pth = fs::current_path();
path = pth.string();
cout << path;
path = path + "\\DataFiles";
pth = path;
if (fs::create_directory(pth))
cout << "\n\n\n Set up data File folder: \n " + path + " \n\n";
return 0;
}
I know that; the API is the same as far as I can tell. The post was edited in 2019 only to change the using declaration; the rest of it stayed the same.