mirror of
https://github.com/Tencent/MMKV.git
synced 2026-10-29 03:46:43 +08:00
change to access() to detect file existence
This commit is contained in:
+1
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user