Linux: Fixed attempting to write to missing folder
This commit is contained in:
parent
cd665ae688
commit
72729eb579
1 changed files with 6 additions and 2 deletions
|
@ -13,8 +13,12 @@ namespace Mesen.GUI.Config
|
|||
{
|
||||
static private string CreateMimeType(string mimeType, string extension, string description, List<string> mimeTypes, bool addType)
|
||||
{
|
||||
string baseFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), ".local", "share");
|
||||
string filename = Path.Combine(baseFolder, "mime", "packages", mimeType + ".xml");
|
||||
string baseFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), ".local", "share", "mime", "packages");
|
||||
if(!Directory.Exists(baseFolder)) {
|
||||
Directory.CreateDirectory(baseFolder);
|
||||
}
|
||||
string filename = Path.Combine(baseFolder, mimeType + ".xml");
|
||||
|
||||
if(addType) {
|
||||
File.WriteAllText(filename,
|
||||
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
|
||||
|
|
Loading…
Add table
Reference in a new issue