MCPcopy Create free account
hub / github.com/dobin/RedEdr / findFiles

Function findFiles

RedEdr/logreader.cpp:84–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83
84std::wstring findFiles(const std::wstring& directory, const std::wstring& pattern) {
85 /*WIN32_FIND_DATA findFileData;
86 HANDLE hFind = INVALID_HANDLE_VALUE;
87 std::wstring fullPattern = directory + L"\\" + pattern;
88
89 // Find the first file in the directory
90 hFind = FindFirstFile(fullPattern.c_str(), &findFileData);
91
92 if (hFind == INVALID_HANDLE_VALUE) {
93 LOG_A(LOG_ERROR, "LOG: No files found matching the pattern: %ls", pattern.c_str());
94 return L"";
95 }
96 else {
97 do {
98 //std::wcout << findFileData.cFileName << std::endl;
99 return directory + L"\\" + findFileData.cFileName;
100 } while (FindNextFile(hFind, &findFileData) != 0);
101
102 DWORD dwError = GetLastError();
103 FindClose(hFind);
104 if (dwError != ERROR_NO_MORE_FILES) {
105 LOG_A(LOG_ERROR, "LOG: Error occurred while finding files: %d", dwError);
106 return L"";
107 }
108 }
109 */
110 return L"";
111}
112
113
114DWORD WINAPI LogReaderProcessingThread(LPVOID param) {

Callers 1

InitializeLogReaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected