[C++]文件文件夹的创建和删除操作

it2022-05-05  138

#include <io.h> //判断文件夹是否存在 #include <direct.h> //创建文件夹 //创建本地目录 int createDir(const char* localPath ) { if(0 == _access(localPath,0)) //判断文件夹是否存在 return 0; if(0 != _mkdir(localPath) ) //创建目录 return -1; return 0; } //删除文件 int delFile(const char* filePath) { if(0 != _access(filePath,0)) //判断文件是否存在 return 0; if(0 == remove(filePath)) //删除文件 return 0; //删除Tmp文件夹,只能删除空文件夹 //rmdir(TmpFolder.c_str()); return -1; }

 

转载于:https://www.cnblogs.com/jingdian1956/p/6557766.html

相关资源:DirectX修复工具V4.0增强版

最新回复(0)