delete lnk file in /data/app/el2/userid/base

Signed-off-by: small_leek <xiasenlin1@huawei.com>
This commit is contained in:
small_leek 2024-11-05 16:36:24 +08:00
parent b7821e6463
commit 212cafd7e9

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;