From 87578391cdc5652efdc4cd007ea40da154f6ae00 Mon Sep 17 00:00:00 2001 From: guoling Date: Tue, 19 Mar 2024 21:19:15 +0800 Subject: [PATCH] change to access() to detect file existence --- Core/MemoryFile.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/MemoryFile.cpp b/Core/MemoryFile.cpp index 3877ecfb..8f6b6714 100644 --- a/Core/MemoryFile.cpp +++ b/Core/MemoryFile.cpp @@ -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) {