!7403 /data/app/el2/100/base/下应用目录中的软链接无法删除

Merge pull request !7403 from small_leek/dellnk
This commit is contained in:
openharmony_ci 2024-11-05 11:09:06 +00:00 committed by Gitee
commit 0ee6d8ce23
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -833,11 +833,14 @@ bool InstalldOperator::DeleteFilesExceptDirs(const std::string &dataPath, const
filePath = OHOS::IncludeTrailingPathDelimiter(dataPath) + std::string(ptr->d_name);
if (ptr->d_type == DT_DIR) {
ret = OHOS::ForceRemoveDirectory(filePath);
} else {
if (access(filePath.c_str(), F_OK) == 0) {
ret = OHOS::RemoveFile(filePath);
}
continue;
}
if (access(filePath.c_str(), F_OK) == 0) {
ret = OHOS::RemoveFile(filePath);
continue;
}
// maybe lnk_file
ret = CheckAndDeleteLinkFile(filePath);
}
closedir(dir);
return ret;