----------------------------------------------------------------------------- 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 /)
| 257 | // the pathname is assumed to be a file path, and only the directory part |
| 258 | // will be examined (everything before last /) |
| 259 | bool 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. |
no test coverage detected