Subroutine that keeps only the file from a path
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | file_path |
function filename(file_path) !! Subroutine that keeps only the file from a path implicit none character(len = * ), intent(in) :: file_path character(len = :), allocatable :: filename character(len = 1) :: sep integer(kind = I4) :: ind sep = dir_separator() ind = index( file_path, sep, back = .true. ) filename = trim( file_path( ind + 1: ) ) return endfunction filename