Directory GetRootDirectory(PathName name) { string root = Path.GetPathRoot(name.GetAbsolutePath()); var di = new DirectoryInfo(root); return new DotNetDirectory(DirectoryName.GetDirectoryName(di.FullName)); }
Directory ResolveDirectory(PathName name) { Directory rootDirectory = GetRootDirectory(name); string relativePath = name.GetAbsolutePath().Substring(rootDirectory.Name.GetPath().Length); string[] names = relativePath.Split('\\', '/'); return ResolveDirectory(rootDirectory, names); }