Class pathname
File path string functions. Parse, combine, make full, make unique, make valid, expand variables, etc.
public static class pathname
Remarks
Most functions of this class work with strings and don't access the file system. Several functions query file system info.
Functions of this class don't throw exceptions when path is invalid (path format, invalid characters). Only pathname.normalize throws exception if not full path.
Also you can use .NET class System.IO.Path. In its documentation you'll find more info about paths.
Namespace: Au
Assembly: Au.dll
Fields
Name | Description |
---|---|
maxDirectoryPathLength | Maximal directory path length supported by all functions (native, .NET and this library).
For longer paths need |
maxFilePathLength | Maximal file (not directory) path length supported by all functions (native, .NET and this library).
For longer paths need |
Methods
Name | Description |
---|---|
combine(string, string, bool, bool) | Combines two path parts using character |
correctName(string, string) | Replaces characters that cannot be used in file names. |
expand(string, bool?) | If path starts with |
findExtension(ReadOnlySpan<char>) | Finds filename extension, like |
getDirectory(string, bool) | Removes filename part from path.
By default also removes separator ( |
getExtension(string) | Gets filename extension, like |
getExtension(string, out string) | Gets filename extension and path part without the extension. More info: getExtension(string). |
getName(string) | Gets filename from path. Does not remove extension. |
getNameNoExt(string) | Gets filename without extension. |
getRootLength(ReadOnlySpan<char>) | Gets the length of the drive or network folder part in path, like |
getUrlProtocolLength(ReadOnlySpan<char>) | Gets the length of the URL protocol name (also known as URI scheme) in string, including |
isFullPath(ReadOnlySpan<char>, bool) | Returns |
isFullPathExpand(ref string, bool?) | Expands environment variables and calls/returns pathname.isFullPath. |
isInvalidName(string) | Returns |
isInvalidNameChar(char) | Returns |
isInvalidPathChar(char) | Returns |
isUrl(ReadOnlySpan<char>) | Returns |
makeUnique(string, bool) | Creates path with unique filename for a new file or directory.
If the specified path is of an existing file or directory, returns path where the filename part is modified like |
normalize(string, string, PNFlags) | Makes normal full path from path that can contain special substrings etc. |
prefixLongPath(string) | If path is full path (see pathname.isFullPath) and does not start with |
prefixLongPathIfNeed(string) | Calls pathname.prefixLongPath if path is longer than pathname.maxDirectoryPathLength (247). |
unprefixLongPath(string) | If path starts with |