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