fglob Subroutine

public subroutine fglob(search_name, filename, rc)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: search_name
character(len=*), intent(inout) :: filename
integer, intent(out), optional :: rc

Calls

proc~~fglob~~CallsGraph proc~fglob fglob interface~f_call_c_glob f_call_c_glob proc~fglob->interface~f_call_c_glob interface~mapl_am_i_root MAPL_Am_I_Root proc~fglob->interface~mapl_am_i_root interface~mapl_assert MAPL_Assert proc~fglob->interface~mapl_assert

Called by

proc~~fglob~~CalledByGraph proc~fglob fglob proc~get_filename_from_template_use_index get_filename_from_template_use_index proc~get_filename_from_template_use_index->proc~fglob proc~find_m_files_for_currtime Find_M_files_for_currTime proc~find_m_files_for_currtime->proc~get_filename_from_template_use_index

Source Code

  subroutine fglob(search_name, filename, rc)     ! give the last name
    character(len=*), intent(in) ::  search_name
    character(len=*), intent(INOUT) :: filename
    integer, optional, intent(out)  :: rc

    character(kind=C_CHAR, len=:), allocatable :: c_search_name
    character(kind=C_CHAR, len=512) :: c_filename
    integer :: slen, lenmax

    c_search_name = trim(search_name)//C_NULL_CHAR
    rc = f_call_c_glob(c_search_name, c_filename, slen)
    filename=""
    lenmax = len(filename)
    if (lenmax < slen) then
       if (MAPL_AM_I_ROOT())  write(6,*) 'pathlen vs filename_max_char_len: ', slen, lenmax
       _FAIL ('PATHLEN is greater than filename_max_char_len')
    end if
    if (slen>0) filename(1:slen)=c_filename(1:slen)

    return
  end subroutine fglob