diff --git a/Apewer/StorageUtility.cs b/Apewer/StorageUtility.cs index 63d0b42..9dce080 100644 --- a/Apewer/StorageUtility.cs +++ b/Apewer/StorageUtility.cs @@ -437,6 +437,9 @@ namespace Apewer { try { + var dir = Path.GetDirectoryName(path); + if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); + File.WriteAllBytes(path, TextUtility.Bom); return true; } @@ -451,6 +454,9 @@ namespace Apewer var success = false; try { + var dir = Path.GetDirectoryName(path); + if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); + var write1 = BytesUtility.Write(file, TextUtility.Bom); if (write1 == TextUtility.Bom.Length) { @@ -474,6 +480,9 @@ namespace Apewer { try { + var dir = Path.GetDirectoryName(path); + if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); + File.WriteAllBytes(path, bytes); return true; }