创建文件夹修复

This commit is contained in:
rci
2024-10-08 10:09:26 +08:00
parent a90d0d2471
commit 2fc439a2b3
2 changed files with 7 additions and 12 deletions
@@ -306,16 +306,11 @@ public:
}
return normalizedAddress;
}
static void createDirectoryIfNotExists(const std::string& path) {
// 检查路径是否存在
if (!std::filesystem::exists(path)) {
// 创建路径
std::filesystem::create_directories(path);
//std::cout << "已创建文件夹: " << path << std::endl;
}
else {/*
std::cout << "文件夹已存在: " << path << std::endl;*/
static void createDirectoryIfNotExists(const QString& path) {
QDir dir(path);
if (dir.exists() == false)
{
dir.mkpath(path);
}
}
static bool setFileReadOnly(const std::string& filePath, bool readOnly);