/// <summary> /// Makes sure the save directory exists /// </summary> public static void MakeSureDirectoryExists(string path) { using var directory = new Directory(); var result = directory.MakeDirRecursive(path); if (result != Error.AlreadyExists && result != Error.Ok) { throw new IOException($"can't create folder: {path}"); } }
public void Create(bool recursive = true) { using (var directory = new Directory()) { if (recursive) { directory.MakeDir(Path).ThrowOnError(); } else { directory.MakeDirRecursive(Path).ThrowOnError(); } } }