mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-03 19:54:13 +13:00
Create directory if not exists when saving settings
This commit is contained in:
parent
6d17b2e75d
commit
df60a0db7e
1 changed files with 2 additions and 0 deletions
|
@ -59,6 +59,8 @@ public static bool Save(object obj, string filePath, SerializationType type, boo
|
|||
{
|
||||
string tempFilePath = filePath + ".temp";
|
||||
|
||||
Helpers.CreateDirectoryIfNotExist(filePath, true);
|
||||
|
||||
using (FileStream fs = new FileStream(tempFilePath, FileMode.Create, FileAccess.Write, FileShare.Read))
|
||||
{
|
||||
Save(obj, fs, type);
|
||||
|
|
Loading…
Reference in a new issue