C Library Functions  - joinpath (3)

NAME

joinpath(3f) - [M_io:PATHNAMES] join parts of a pathname together (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Examples
Author
License

SYNOPSIS

function joinpath(a1,a2,a3,a4,a5,a6,a7,a8,a9)
  result(path)
    character(len=*), intent(in)           :: a1, a2
    character(len=*), intent(in), optional :: a3, a4, a5, a6, a7, a8, a9
    character(len=:), allocatable          :: path

DESCRIPTION

OPTIONS

a1,a2 the first two pathname sections to join. Required
a3-a9 additional optional sections to join

RETURNS

pathname sections joined together with trailing spaces removed from the ends of sections and a separator (as returned by separator(3f) ) placed between them, and duplicate adjacent separators removed accept for one beginning the joined pathname.

EXAMPLES

Sample program

     program demo_joinpath
     use M_io, only : joinpath
     implicit none
        write(*,*)joinpath(&
        &’/share/user’,’/man/’,’man3’,’joinpath.3m_io’//’.gz’ &
        &)
     end program demo_joinpath

Results:

     >  /share/user/man/man3/joinpath.3m_io.gz

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 joinpath (3) August 28, 2026
Generated by manServer 1.08 from 459a6dc8-5ec3-46a9-bc0e-d578739cc25b using man macros.