[This is preliminary documentation and is subject to change.]
The Paths type exposes the following methods.
Methods
| Member | Description | |
|---|---|---|
| Compare(String, String) | Checks whether two paths/file names reference the exact same filesystem location. Accounts for filesystem quirks. | |
| Compare(String, String, Boolean) | Checks whether two paths/file names reference the exact same filesystem location.
Allows specifying whether comparison should be case-sensitive or not. | |
| Contains(String, String) | Checks whether childPath is inside parentPath. Accounts for filesystem quirks. | |
| Contains(String, String, Boolean) | Checks whether childPath is inside parentPath. | |
| Exists(FileInfo, Boolean) | Checks whether the file exists in a specified way (case-sensitive or case-insensitive). | |
| FileExists(String, Boolean) | Checks whether the file exists in a specified way (case-sensitive or case-insensitive) | |
| FindFiles(String) | Find files that match the name in a case-insensitive way. | |
| ForceRename(String, String) | Allows making changes to file name capitalization on case-insensitive filesystems. | |
| GetDirectoryNameOrRoot(String) | Gets full directory name for a given path, or path root for directory-less paths.
Uses either Path.GetDirectoryName or Path.GetPathRoot to get the result. | |
| IsProtectedFileName(String) | Checks whether the given file is on a list of protected file names.
Protected file names include all fCraft binaries, configuration files, and data files. | |
| IsValidPath(String) | Checks whether the given path is valid.
Does NOT check for existence of the file/directory at the given path. | |
| MoveOrReplaceFile(String, String) | Moves file from source to destination, overwriting destination if it exists, as safely as possible.
File.Replace, File.Copy/File.Delete, or File.Move is used depending on circumstances. | |
| TestDirectory(String, String, Boolean) | Makes sure that the path format is valid, that it exists, that it is accessible and writeable. | |
| TestFile(String, String, Boolean, FileAccess) | Makes sure that the path format is valid, and optionally whether it is readable/writeable. |