Guest User

Untitled

a guest
Jul 17th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. PATH = internalDirectory + "/Settings";
  2.  
  3.  
  4. DIR* dir = opendir(PATH.data());
  5. if (!dir) { // Install
  6. if (errno == ENOENT) { /* Directory does not exist. */
  7. SFLOGI("Settings: Installing");
  8. // Create the dirs for first time - Installation
  9. createDirs(PATH, S_IRUSR | S_IWUSR);
  10.  
  11. // Copy files from Assets to user memory
  12. copyFiles();
  13. }
  14. }
  15.  
  16.  
  17. DIR* dir2 = opendir(PATH.data());
  18. if (dir2 != NULL) { /* Directory exists. */
  19. SFLOGI("Settings: Loading...");
  20. struct dirent *ent;
  21.  
  22. while ((ent = readdir(dir2)) != NULL) {
  23. //File file;
  24. //file.name = ent->d_name;
  25. //if (ent->d_type == DT_REG) {
  26. SFLOGI("name= %s", ent->d_name);
  27. //}
  28. }
  29.  
  30. closedir(dir2);
  31. }
Add Comment
Please, Sign In to add comment