MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / is_dir

Method is_dir

core/src/utils/file.cc:23–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23bool file::is_dir(const path &path)
24{
25#if OS_WIN
26 DWORD attr = GetFileAttributesW(path.wstring().c_str());
27 if (attr == INVALID_FILE_ATTRIBUTES)
28 return false;
29 return attr & FILE_ATTRIBUTE_DIRECTORY;
30#elif OS_MAC
31 struct stat buffer;
32 if (stat(path.string().c_str(), &buffer) == 0) {
33 return S_ISDIR(buffer.st_mode);
34 }
35 return false;
36#endif
37}
38
39bool file::is_file(const path &path)
40{

Callers

nothing calls this directly

Calls 2

statClass · 0.85
stringMethod · 0.80

Tested by

no test coverage detected