自动创建文件夹
class test { private: test(); ~test(); bool EnsureDirectoryExists(const std::string& path); static const std::string filePath; }; const std::string test::FilePath = "\database\\"; bool test::EnsureDirectoryExists(const std::string& path) { if (_access(path.c_str(), 0) != 0) { if (_mkdir(path.c_str()) != 0) { LOGGER_ERROR("Failed to create directory."); return false; } } return true; }

浙公网安备 33010602011771号