| 37 | } |
| 38 | |
| 39 | void menuStartupPath(void) { |
| 40 | char temp[PATH_MAX + 29]; |
| 41 | |
| 42 | #if defined(__3DS__) |
| 43 | strncpy(rootPathBase, "sdmc:", sizeof(rootPathBase) - 1); |
| 44 | #else |
| 45 | getcwd(rootPathBase, sizeof(rootPathBase)); |
| 46 | #endif |
| 47 | |
| 48 | snprintf(rootPath, sizeof(rootPath) - 1, "%s%s%s", rootPathBase, DIRECTORY_SEPARATOR, "3ds"); |
| 49 | |
| 50 | struct stat fileStat = {0}; |
| 51 | |
| 52 | /* create the root directory */ |
| 53 | if (stat(rootPath, &fileStat) == -1) |
| 54 | mkdir(rootPath, 0755); |
| 55 | |
| 56 | /* create the /config directory */ |
| 57 | snprintf(temp, sizeof(temp) - 1, "%s/config", rootPathBase); |
| 58 | mkdir(temp, 0755); |
| 59 | |
| 60 | /* create /config/3ds-hbmenu directory */ |
| 61 | snprintf(temp, sizeof(temp) - 1, "%s/config/3ds-hbmenu", rootPathBase); |
| 62 | mkdir(temp, 0755); |
| 63 | |
| 64 | snprintf(temp, sizeof(temp) - 1, "%s/config/3ds-hbmenu/fileassoc", rootPathBase); |
| 65 | |
| 66 | /* create /config/3ds-hbmenu/fileassoc */ |
| 67 | if (stat(temp, &fileStat) == -1) |
| 68 | mkdir(temp, 0755); |
| 69 | } |
| 70 | |
| 71 | void menuLoadFileAssoc(void) { |
| 72 | char temp[PATH_MAX + 29]; |