MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / is_file

Function is_file

examples/server/httplib.h:2088–2095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2086}
2087
2088inline bool is_file(const std::string &path) {
2089#ifdef _WIN32
2090 return _access_s(path.c_str(), 0) == 0;
2091#else
2092 struct stat st;
2093 return stat(path.c_str(), &st) >= 0 && S_ISREG(st.st_mode);
2094#endif
2095}
2096
2097inline bool is_dir(const std::string &path) {
2098 struct stat st;

Callers 1

handle_file_requestMethod · 0.85

Calls 2

statClass · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected