Class FileSystemUtils
public static class FileSystemUtils
- Inheritance
-
FileSystemUtils
- Inherited Members
Methods
BrowseFileInExplorer(string)
Opens file explorer and selects specified file
public static void BrowseFileInExplorer(string path)
Parameters
path
string
BrowseFolderInExplorer(string)
Opens file explorer at the specified folder
public static void BrowseFolderInExplorer(string path)
Parameters
path
string
CombinePaths(string, params string[])
Combines the directory paths
public static string CombinePaths(string srcPath, params string[] additionalPaths)
Parameters
Returns
- string
Combined path
Remarks
This method works with relative path, including moving the upper folders via ..
GetRelativePath(string, string)
Finds the relative path
public static string GetRelativePath(string thisPath, string relativeToDir)
Parameters
Returns
- string
Relative path
Exceptions
GetTopFolders(IEnumerable<string>)
Excludes all sub level folders and only returns top level folders
public static string[] GetTopFolders(IEnumerable<string> paths)
Parameters
paths
IEnumerable<string>Input directory paths
Returns
- string[]
Top level folders paths
IsInDirectory(string, string)
Checks if the specified path is in the other directory
public static bool IsInDirectory(string thisPath, string parentDir)
Parameters
Returns
- bool
True of directory is within another directory
ReplaceIllegalRelativePathCharacters(string, Func<char, char>)
Replaces illegal characters in the relative file path (rooted path is not supported)
public static string ReplaceIllegalRelativePathCharacters(string path, Func<char, char> replacer)
Parameters
Returns
- string
Legal file path