| 147 | //----------------------------------------------------------------------------- |
| 148 | |
| 149 | bool Platform::deleteDirectory(const char* pPath) |
| 150 | { |
| 151 | // Sanity! |
| 152 | AssertFatal(pPath != NULL, "Cannot delete directory that is NULL."); |
| 153 | |
| 154 | // Is the path a file? |
| 155 | if (Platform::isFile(pPath)) |
| 156 | { |
| 157 | // Yes, so warn. |
| 158 | Con::warnf("Cannot delete directory '%s' as it specifies a file.", pPath); |
| 159 | return false; |
| 160 | } |
| 161 | |
| 162 | // Expand module location. |
| 163 | char pathBuffer[1024]; |
| 164 | Con::expandPath(pathBuffer, sizeof(pathBuffer), pPath, NULL, true); |
| 165 | |
| 166 | // Delete directory recursively. |
| 167 | return deleteDirectoryRecusrive(pathBuffer); |
| 168 | } |
| 169 | |
| 170 | //----------------------------------------------------------------------------- |
| 171 |
nothing calls this directly
no test coverage detected