dir/name, without doubling a separator. A trailing \ or : (Windows) also counts.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | dir |
the directory, and the name to append to it |
||
| character(len=*), | intent(in) | :: | name |
the directory, and the name to append to it |
pure function join_path(dir, name) result(path) !! `dir/name`, without doubling a separator. A trailing `\` or `:` (Windows) also counts. character(len=*), intent(in) :: dir, name !! the directory, and the name to append to it character(len=:), allocatable :: path if (len(dir) == 0) then path = name else if (index('/\:', dir(len(dir):len(dir))) > 0) then path = dir//name else path = dir//'/'//name end if end function join_path