MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / DirExists

Function DirExists

Engine/source/platformPOSIX/POSIXFileio.cpp:269–281  ·  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

267// the pathname is assumed to be a file path, and only the directory part
268// will be examined (everything before last /)
269bool DirExists(char* pathname, bool isFile)
270{
271 static char testpath[20000];
272 dStrncpy(testpath, pathname, sizeof(testpath));
273 if (isFile)
274 {
275 // find the last / and make it into null
276 char* lastSlash = dStrrchr(testpath, '/');
277 if (lastSlash != NULL)
278 *lastSlash = 0;
279 }
280 return Platform::isDirectory(testpath);
281}
282
283//-----------------------------------------------------------------------------
284// Munge the specified path.

Callers 1

createPathMethod · 0.85

Calls 2

dStrncpyFunction · 0.85
dStrrchrFunction · 0.50

Tested by

no test coverage detected