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

Method is_file

core/src/utils/file.cc:39–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39bool file::is_file(const path &path)
40{
41#if OS_WIN
42 DWORD attr = GetFileAttributesW(path.wstring().c_str());
43 if (attr == INVALID_FILE_ATTRIBUTES)
44 return false;
45 return !(attr & FILE_ATTRIBUTE_DIRECTORY);
46#elif OS_MAC
47 struct stat buffer;
48 if (stat(path.string().c_str(), &buffer) == 0) {
49 return S_ISREG(buffer.st_mode);
50 }
51 return false;
52#endif
53}
54
55bool file::read_file(const path &path, void **buffer, size_t *length)
56{

Callers

nothing calls this directly

Calls 2

statClass · 0.85
stringMethod · 0.80

Tested by

no test coverage detected