| 27 | } |
| 28 | |
| 29 | OSFindFilesResult osFindFilesInDirectoryMatchingPattern( |
| 30 | CoreLib::Basic::String directoryPath, |
| 31 | CoreLib::Basic::String pattern) |
| 32 | { |
| 33 | // TODO: add separator to end of directory path if needed |
| 34 | |
| 35 | String searchPath = directoryPath + pattern; |
| 36 | |
| 37 | OSFindFilesResult result; |
| 38 | HANDLE findHandle = FindFirstFileW( |
| 39 | searchPath.ToWString(), |
| 40 | &result.fileData_); |
| 41 | |
| 42 | result.directoryPath_ = directoryPath; |
| 43 | result.findHandle_ = findHandle; |
| 44 | |
| 45 | if (findHandle == INVALID_HANDLE_VALUE) |
| 46 | { |
| 47 | result.error_ = kOSError_FileNotFound; |
| 48 | } |
| 49 | else |
| 50 | { |
| 51 | result.filePath_ = directoryPath + String::FromWString(result.fileData_.cFileName); |
| 52 | result.error_ = kOSError_None; |
| 53 | } |
| 54 | |
| 55 | return result; |
| 56 | } |
| 57 | |
| 58 | // OSProcessSpawner |
| 59 |
no test coverage detected