Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is where the output gets written.
- FILE* textFile = _wfopen (L"Peek.txt", L"wt,ccs=UTF8");
- WIN32_FIND_DATAW fdf;
- HANDLE find = NULL;
- wchar_t fullPath[2048];
- // I am just showing the third argument as a literal to exemplify
- // what, in reality is passed into the recursively-called function as
- // a variable.
- wsprintf (fullPath, L"\\?\%ls\*.*", L"F:\");
- hFind = FindFirstFile (fullPath, &fdf);
- // After checking for success there appears a do..while loop
- // inside which there is the expected check for the "." and ".."
- // pseudo directories and a test of fdf.dwFileAttributes for
- // file versus sub-directory.
- // When the NextFile is a file a function is called to format
- // the output in the textFile, like this:
- fwprintf (textF, L"%lst%lst%2.2xt%4d/%02d/%02d/%02d/%02d/%02d t%9ld.n",
- parentPath, fdf.cFileName,
- (fdf.dwFileAttributes & 0x0f),
- st.wYear, st.wMonth, st.wDay,
- st.wHour, st.wMinute, st.wSecond,
- fSize);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement