From 89fca2b875c3f302349c8e0672f077d56357da04 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Wed, 16 Oct 2013 17:49:14 -0500 Subject: [PATCH] Create folders when writing a new gamelist.xml if necessary. --- src/XMLReader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/XMLReader.cpp b/src/XMLReader.cpp index d8cf5da28..e6d915ce7 100644 --- a/src/XMLReader.cpp +++ b/src/XMLReader.cpp @@ -215,6 +215,10 @@ void updateGamelist(SystemData* system) }else{ //set up an empty gamelist to append to doc.append_child("gameList"); + + //make sure the folders leading up to this path exist (or the XML file write will fail later on) + boost::filesystem::path path(xmlpath); + boost::filesystem::create_directories(path.parent_path()); }