----------------------------------------------------------------------------- perform a modification on the specified file. allowed modifications are specified in the enum above.
| 313 | // perform a modification on the specified file. allowed modifications are |
| 314 | // specified in the enum above. |
| 315 | bool ModifyFile(const char * name, S32 modType) |
| 316 | { |
| 317 | if(!name || (dStrlen(name) >= MAX_PATH) || dStrstr(name, "../") != NULL) |
| 318 | return(false); |
| 319 | |
| 320 | // if its absolute skip it |
| 321 | if (name[0]=='/' || name[0]=='\\') |
| 322 | return(false); |
| 323 | |
| 324 | // only modify files in home directory |
| 325 | char prefPathName[MaxPath]; |
| 326 | MungePath(prefPathName, MaxPath, name, GetPrefDir()); |
| 327 | |
| 328 | if (modType == TOUCH) |
| 329 | return(utime(prefPathName, 0) != -1); |
| 330 | else if (modType == DELETE) |
| 331 | return (remove(prefPathName) != -1); |
| 332 | else |
| 333 | AssertFatal(false, "Unknown File Mod type"); |
| 334 | return false; |
| 335 | } |
| 336 | |
| 337 | //----------------------------------------------------------------------------- |
| 338 | static bool RecurseDumpPath(const char *path, const char* relativePath, const char *pattern, Vector<Platform::FileInfo> &fileVector, int recurseDepth) |
no test coverage detected