True if path starts with / or \, or has a drive letter such as C:.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | path |
the path to test |
pure logical function is_absolute(path) !! True if `path` starts with `/` or `\`, or has a drive letter such as `C:`. character(len=*), intent(in) :: path !! the path to test is_absolute = .false. if (len(path) == 0) return is_absolute = path(1:1) == '/' .or. path(1:1) == '\' if (len(path) >= 2) is_absolute = is_absolute .or. path(2:2) == ':' end function is_absolute