MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / DirExists

Function DirExists

engine/source/platformEmscripten/EmscriptenFileio.cpp:259–271  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Returns true if the pathname exists, false otherwise. If isFile is true, the pathname is assumed to be a file path, and only the directory part will be examined (everything before last /)

Source from the content-addressed store, hash-verified

257// the pathname is assumed to be a file path, and only the directory part
258// will be examined (everything before last /)
259bool DirExists(char* pathname, bool isFile)
260{
261 static char testpath[20000];
262 dStrncpy(testpath, pathname, sizeof(testpath));
263 if (isFile)
264 {
265 // find the last / and make it into null
266 char* lastSlash = dStrrchr(testpath, '/');
267 if (lastSlash != NULL)
268 *lastSlash = 0;
269 }
270 return Platform::isDirectory(testpath);
271}
272
273//-----------------------------------------------------------------------------
274// Munge the specified path.

Callers 1

createPathMethod · 0.70

Calls 2

dStrncpyFunction · 0.70
dStrrchrFunction · 0.70

Tested by

no test coverage detected