join_path Function

public pure function join_path(dir, name) result(path)

dir/name, without doubling a separator. A trailing \ or : (Windows) also counts.

Arguments

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

the directory, and the name to append to it

character(len=*), intent(in) :: name

the directory, and the name to append to it

Return Value character(len=:), allocatable


Called by

proc~~join_path~~CalledByGraph proc~join_path join_path proc~absolute_path absolute_path proc~absolute_path->proc~join_path proc~child child proc~child->proc~join_path proc~find_config find_config proc~find_config->proc~join_path proc~list_directory list_directory proc~list_directory->proc~join_path proc~collect_files collect_files proc~collect_files->proc~child proc~collect_files->proc~list_directory proc~config_for config_for proc~config_for->proc~find_config proc~directory_files directory_files proc~directory_files->proc~absolute_path proc~directory_files->proc~collect_files proc~directory_files->proc~config_for proc~options_for options_for proc~options_for->proc~absolute_path proc~options_for->proc~config_for proc~process_file process_file proc~process_file->proc~absolute_path proc~process_text process_text proc~process_file->proc~process_text proc~process_text->proc~options_for proc~run run proc~run->proc~directory_files proc~run->proc~process_file proc~process_stdin process_stdin proc~run->proc~process_stdin proc~process_stdin->proc~process_text

Source Code

pure function join_path(dir, name) result(path)
    !! `dir/name`, without doubling a separator. A trailing `\` or `:` (Windows) also counts.
    character(len=*), intent(in) :: dir, name   !! the directory, and the name to append to it
    character(len=:), allocatable :: path
    if (len(dir) == 0) then
        path = name
    else if (index('/\:', dir(len(dir):len(dir))) > 0) then
        path = dir//name
    else
        path = dir//'/'//name
    end if
end function join_path