diff --git a/cocos/platform/linux/CCFileUtils-linux.cpp b/cocos/platform/linux/CCFileUtils-linux.cpp index 376a664905..1e45f26ab1 100644 --- a/cocos/platform/linux/CCFileUtils-linux.cpp +++ b/cocos/platform/linux/CCFileUtils-linux.cpp @@ -124,7 +124,7 @@ bool FileUtilsLinux::isFileExistInternal(const std::string& strFilePath) const } struct stat sts; - return (stat(strPath.c_str(), &sts) != -1) ? true : false; + return (stat(strPath.c_str(), &sts) == 0) && S_ISREG(sts.st_mode); } NS_CC_END