mirror of https://github.com/axmolengine/axmol.git
[linux] CCFileUtils::isFileExistInternal should reject a folder (#19062)
* accept regular file only * simplify code
This commit is contained in:
parent
a6530a5aca
commit
6ea37d4c9d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue