Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. void scanFolder(const char *dirName) {
  2. if (DIR *pDIR = opendir(dirName)) {
  3. while (auto entry = readdir(pDIR)) {
  4. char *fileName = entry->d_name;
  5. if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) {
  6. if (isFolder(fileName)) {
  7. //found another folder scan deeper
  8. scanFolder(fileVector, fileName);
  9. } else {
  10. //found a file
  11. std::string str = dirName;
  12. str.append("/").append(fileName);
  13. }
  14. }
  15. }
  16.  
  17. closedir(pDIR);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement