filename Function

public function filename(file_path)

Subroutine that keeps only the file from a path

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: file_path

Return Value character(len=:), allocatable


Calls

proc~~filename~~CallsGraph proc~filename filename proc~dir_separator dir_separator proc~filename->proc~dir_separator proc~is_linux is_linux proc~dir_separator->proc~is_linux

Called by

proc~~filename~~CalledByGraph proc~filename filename program~test_files test_files program~test_files->proc~filename

Source Code

   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