C Library Functions  - joinpath (3)

NAME

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

CONTENTS

Synopsis
Description
Options
Returns
Example
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.

EXAMPLE

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) July 22, 2023
Generated by manServer 1.08 from c14d6ef2-961a-4a97-b664-769e2b39b2a9 using man macros.