/// <summary>Deletes the directory</summary> /// <exception cref="System.IO.IOException"></exception> public static void DeleteDir(string dir) { var absolutePath = new File(dir).GetCanonicalPath(); var fDir = new File(dir); if (fDir.IsDirectory()) { var files = fDir.List(); for (var i = 0; i < files.Length; i++) { DeleteDir(Path.Combine(absolutePath, files[i])); } } File4.Delete(dir); }
/// <summary>Deletes the directory</summary> /// <exception cref="System.IO.IOException"></exception> public static void DeleteDir(string dir) { string absolutePath = new Sharpen.IO.File(dir).GetCanonicalPath(); Sharpen.IO.File fDir = new Sharpen.IO.File(dir); if (fDir.IsDirectory()) { string[] files = fDir.List(); for (int i = 0; i < files.Length; i++) { DeleteDir(Path.Combine(absolutePath, files[i])); } } File4.Delete(dir); }
/// <exception cref="System.IO.IOException"></exception> internal void EnsureDirExists(string path) { Sharpen.IO.File file = new Sharpen.IO.File(path); if (!file.Exists()) { file.Mkdirs(); } if (file.Exists() && file.IsDirectory()) { } else { throw new IOException(Db4objects.Db4o.Internal.Messages.Get(37, path)); } }
/// <exception cref="System.IO.IOException"></exception> internal void EnsureDirExists(string path) { var file = new File(path); if (!file.Exists()) { file.Mkdirs(); } if (file.Exists() && file.IsDirectory()) { } else { throw new IOException(Messages.Get(37, path)); } }