change to access() to detect file existence

This commit is contained in:
guoling
2024-03-19 21:19:15 +08:00
parent 5dcd8f43d8
commit 87578391cd
+1 -2
View File
@@ -267,8 +267,7 @@ bool isFileExist(const string &nsFilePath) {
return false;
}
struct stat temp = {};
return lstat(nsFilePath.c_str(), &temp) == 0;
return access(nsFilePath.c_str(), F_OK) == 0;
}
extern bool mkPath(const MMKVPath_t &str) {