diff --git a/deploy/installer/LANDIS-II-V7 Base Wind 3.2-setup.exe b/deploy/installer/LANDIS-II-V7 Base Wind 3.2-setup.exe index 88851eb..4e90bc8 100644 Binary files a/deploy/installer/LANDIS-II-V7 Base Wind 3.2-setup.exe and b/deploy/installer/LANDIS-II-V7 Base Wind 3.2-setup.exe differ diff --git a/src/MetadataHandler.cs b/src/MetadataHandler.cs index c00889f..770022f 100644 --- a/src/MetadataHandler.cs +++ b/src/MetadataHandler.cs @@ -5,6 +5,7 @@ using Landis.Library.Metadata; using Landis.Utilities; using Landis.Core; +using System.IO; namespace Landis.Extension.BaseWind { @@ -32,6 +33,9 @@ public static void InitializeMetadata(int Timestep, string MapFileName, string s // table outputs: //--------------------------------------- + CreateDirectory(eventLogFileName); + CreateDirectory(summaryLogFileName); + PlugIn.eventLog = new MetadataTable(eventLogFileName); PlugIn.summaryLog = new MetadataTable(summaryLogFileName); @@ -76,9 +80,24 @@ public static void InitializeMetadata(int Timestep, string MapFileName, string s MetadataProvider mp = new MetadataProvider(Extension); mp.WriteMetadataToXMLFile("Metadata", Extension.Name, Extension.Name); + } + public static void CreateDirectory(string path) + { + //Require.ArgumentNotNull(path); + path = path.Trim(null); + if (path.Length == 0) + throw new ArgumentException("path is empty or just whitespace"); + //throw new Exception(path); + string dir = Path.GetDirectoryName(path); + if (!string.IsNullOrEmpty(dir)) + { + Landis.Utilities.Directory.EnsureExists(dir); + } - + //return new StreamWriter(path); + return; } + } }