public static FileSystemInfo New(string path) { if (Directory.Exists (path)) return new DirectoryInfo (path); return new FileInfo (path); }