#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING 1;
#include <experimental/filesystem> // or #include <filesystem> for C++17 and up
namespace fs = std::experimental::filesystem;
int CreateFolderIfNotExist(std::string folder) {
if (!fs::is_directory(folder) || !fs::exists(folder)) { // Check if src folder exists
std::ostringstream oss;
oss << "mkdir " + folder; // prevent space in source path
std::string command = oss.str();
std::cout << command << std::endl;
system(command.c_str());
}
return 0;
}
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme