path made absolute by prefixing the current directory, unless it already is
(starts with / or \, or a drive letter such as C:).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | path |
a relative or absolute path |
function absolute_path(path) result(abs) !! `path` made absolute by prefixing the current directory, unless it already is !! (starts with `/` or `\`, or a drive letter such as `C:`). character(len=*), intent(in) :: path !! a relative or absolute path character(len=:), allocatable :: abs if (is_absolute(path)) then abs = path else if (path == '.') then abs = current_directory() else abs = join_path(current_directory(), path) end if end function absolute_path