Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Revers find file in windows
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86 //#define _UNICODE //#define UNICODE #include <stdio.h> #include <windows.h> #include <tchar.h> BOOL IsRoot(LPCTSTR lptszPath) { _TCHAR tszRoot[4]; _stprintf_s(tszRoot, _T("%c:\\"), lptszPath[0]); return (_tcscmp(tszRoot, lptszPath) == 0); } void FindInAll(LPCTSTR lptszPath) { _TCHAR tszFind[MAX_PATH]; _tcscpy_s(tszFind, lptszPath); if (!IsRoot(tszFind)) _tcscat_s(tszFind, _T("\\")); _tcscat_s(tszFind, _T("*.*")); // Find all pattern WIN32_FIND_DATA wfd; HANDLE hFind = FindFirstFile(tszFind, &wfd); if (hFind == INVALID_HANDLE_VALUE) return; do { if (wfd.cFileName[0] == _T('.')) continue; if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { _TCHAR tszFile[MAX_PATH]; if (IsRoot(lptszPath)) _stprintf_s(tszFile, _T("%s%s"), lptszPath, wfd.cFileName); else _stprintf_s(tszFile, _T("%s\\%s"), lptszPath, wfd.cFileName); FindInAll(tszFile); } else { _TCHAR tszFile[MAX_PATH]; if (IsRoot(lptszPath)) _stprintf_s(tszFile, _T("%s%s"), lptszPath, wfd.cFileName); else _stprintf_s(tszFile, _T("%s\\%s"), lptszPath, wfd.cFileName); _tprintf(_T("%s\n"), tszFile); } } while (FindNextFile(hFind, &wfd)); FindClose(hFind); } int main() { FindInAll(_T("windows")); return 0; }
run
|
edit
|
history
|
help
0
3 sayinin toplami
7
move swap
3
Buggy Strcat
Cannot allocate an array of constant size 0
Matrix_1
10dan büyük mü küçük mü
C string literal
Constant table but dynamic initialization at runtime