一些常用的文件操作代码 建立名称为 dirPath的子目录。 #include <direct.h> string dirPath = "Log/web_server_log"; #ifndef WIN32 mkdir(dirPath.c_str(), 0777); #else mkdir(dirPath.c_str()); #endif