create switch folder if it doesn't exist (#39)

Fixes #38.
This commit is contained in:
Dave Murphy 2018-05-30 16:16:16 +01:00 committed by yellows8
parent 4539b8e78d
commit 6544353245

View File

@ -257,6 +257,12 @@ void menuStartup() {
#endif
snprintf(rootPath, sizeof(rootPath)-1, "%s%s%s", tmp_path, DIRECTORY_SEPARATOR, "switch");
struct stat st = {0};
if (stat(rootPath, &st) == -1) {
mkdir(rootPath, 0755);
}
menuScan(rootPath);
folder_icon_small = downscaleImg(folder_icon_bin, 256, 256, 140, 140, IMAGE_MODE_RGB24);