Extract dirname from path
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | filename |
function dirname(filename) character(len=*), intent(in) :: filename character(len=:), allocatable :: dirname dirname = filename(1:scan(filename, "/\", back=.true.)) if (len_trim(dirname) == 0) dirname = "." end function dirname