This commit is contained in:
yhirose 2024-09-02 20:38:01 -04:00
parent 4f9c6540b2
commit 2514ebc20f
2 changed files with 11 additions and 4 deletions

View file

@ -2526,12 +2526,8 @@ inline std::string base64_encode(const std::string &in) {
}
inline bool is_file(const std::string &path) {
#ifdef _WIN32
return _access_s(path.c_str(), 0) == 0;
#else
struct stat st;
return stat(path.c_str(), &st) >= 0 && S_ISREG(st.st_mode);
#endif
}
inline bool is_dir(const std::string &path) {