Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. // This is where the output gets written.
  2. FILE* textFile = _wfopen (L"Peek.txt", L"wt,ccs=UTF8");
  3.  
  4. WIN32_FIND_DATAW fdf;
  5. HANDLE find = NULL;
  6. wchar_t fullPath[2048];
  7.  
  8. // I am just showing the third argument as a literal to exemplify
  9. // what, in reality is passed into the recursively-called function as
  10. // a variable.
  11. wsprintf (fullPath, L"\\?\%ls\*.*", L"F:\");
  12. hFind = FindFirstFile (fullPath, &fdf);
  13.  
  14. // After checking for success there appears a do..while loop
  15. // inside which there is the expected check for the "." and ".."
  16. // pseudo directories and a test of fdf.dwFileAttributes for
  17. // file versus sub-directory.
  18. // When the NextFile is a file a function is called to format
  19. // the output in the textFile, like this:
  20.  
  21. fwprintf (textF, L"%lst%lst%2.2xt%4d/%02d/%02d/%02d/%02d/%02d t%9ld.n",
  22. parentPath, fdf.cFileName,
  23. (fdf.dwFileAttributes & 0x0f),
  24. st.wYear, st.wMonth, st.wDay,
  25. st.wHour, st.wMinute, st.wSecond,
  26. fSize);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement