| 8356 | } |
| 8357 | |
| 8358 | ResultType Line::FileDelete(LPTSTR aFilePattern) |
| 8359 | { |
| 8360 | if (!*aFilePattern) |
| 8361 | return LineError(ERR_PARAM1_INVALID, FAIL_OR_OK); |
| 8362 | |
| 8363 | // The no-wildcard case could be handled via FilePatternApply(), but handling it this |
| 8364 | // way ensures deleting a non-existent path without wildcards is considered a failure: |
| 8365 | if (!StrChrAny(aFilePattern, _T("?*"))) // No wildcards; just a plain path/filename. |
| 8366 | { |
| 8367 | SetLastError(0); // For sanity: DeleteFile appears to set it only on failure. |
| 8368 | return SetLastErrorMaybeThrow(!DeleteFile(aFilePattern)); |
| 8369 | } |
| 8370 | |
| 8371 | // Otherwise aFilePattern contains wildcards, so we'll search for all matches and delete them. |
| 8372 | return FilePatternApply(aFilePattern, FILE_LOOP_FILES_ONLY, false, FileDeleteCallback, NULL); |
| 8373 | } |
| 8374 | |
| 8375 | |
| 8376 |
nothing calls this directly
no test coverage detected