MCPcopy Create free account
hub / github.com/assaultcube/AC / fileexists

Function fileexists

source/src/stream.cpp:110–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110bool fileexists(const char *path, const char *mode)
111{
112 bool exists = true;
113 if(mode[0]=='w' || mode[0]=='a') path = parentdir(path);
114#ifdef WIN32
115 if(GetFileAttributes(path) == INVALID_FILE_ATTRIBUTES) exists = false;
116#else
117 if(access(path, R_OK | (mode[0]=='w' || mode[0]=='a' ? W_OK : 0)) == -1) exists = false;
118#endif
119 return exists;
120}
121
122bool createdir(const char *path)
123{

Callers 6

gettextureoriginFunction · 0.85
trymapfilesFunction · 0.85
findfileFunction · 0.85
loopvFunction · 0.85
menuitemimageFunction · 0.85
getmapsoundoriginFunction · 0.85

Calls 1

parentdirFunction · 0.85

Tested by

no test coverage detected