From 0ea6677869f75763ac2ba841bf1d63fcb4be6134 Mon Sep 17 00:00:00 2001 From: Christian Fetzer Date: Sun, 13 Nov 2016 11:53:20 +0100 Subject: [PATCH] [LibretroResources] Ensure that system directory exists Cores might not only want to read from it, ScummVM wants to store its configuration file into it, so it must exist. --- src/libretro/LibretroResources.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libretro/LibretroResources.cpp b/src/libretro/LibretroResources.cpp index 6840f365..d0379013 100644 --- a/src/libretro/LibretroResources.cpp +++ b/src/libretro/LibretroResources.cpp @@ -56,8 +56,17 @@ void CLibretroResources::Initialize(ADDON::CHelper_libXBMC_addon* addon, const g // Set system path to first resource path discovered if (m_systemDirectory.empty()) + { m_systemDirectory = resourcePath + "/" LIBRETRO_SYSTEM_DIRECTORY_NAME; + // Ensure folder exists + if (!m_addon->DirectoryExists(m_systemDirectory.c_str())) + { + dsyslog("Creating system directory: %s", m_systemDirectory.c_str()); + m_addon->CreateDirectory(m_systemDirectory.c_str()); + } + } + m_resourceDirectories.push_back(std::move(resourcePath)); }