From 6544353245cdf1585010fc62fa9a88ac517ca610 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Wed, 30 May 2018 16:16:16 +0100 Subject: [PATCH] create switch folder if it doesn't exist (#39) Fixes #38. --- common/menu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/menu.c b/common/menu.c index ba2a80c..549d956 100644 --- a/common/menu.c +++ b/common/menu.c @@ -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);