functionhas_drivepureprivate
pure logical function has_drive(path)
True if path starts with a drive letter, as in C:.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| path | character(len=*) | in | the path |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| has_drive | logical |
Source
Show the code
pure logical function has_drive(path)
character(len=*), intent(in) :: path !! the path
has_drive = .false.
if (len(path) < 2) return
has_drive = path(2:2) == ':' .and. verify(path(1:1), 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') == 0
end function has_drive