path is a valid path.isValidPath
fn
bool isValidPath(Range)(Range path) if ((isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range && isSomeChar!(ElementEncodingType!Range) ||
isNarrowString!Range) &&
!isConvertibleToString!Range)Checks whether path is a valid path.
Generally, this function checks that path is not empty, and that each component of the path either satisfies isValidFilename or is equal to `"."` or `".."`.
or directory; use exists for this purpose.
On Windows, some special rules apply:
- If the second character of
pathis a colon (`':'`),the first character is interpreted as a drive letter, and must be in the range A-Z (case insensitive).
- If
pathis on the form\\server\share\...(UNC path), isValidFilename is applied to server and share as well.
- If
pathstarts with`\\?\`(long UNC path), theonly requirement for the rest of the string is that it does not contain the null character.
- If
pathstarts with`\\.\`(Win32 device namespace)this function returns
false; such paths are beyond the scope of this module.
Parameters
path | string or Range of characters to check |
Returns
true if