[UP]


Manual Reference Pages  - lookfor (3)

NAME

lookfor(3f) - [M_io:ENVIRONMENT] look for a filename in a number of directories specified by an environment variable (LICENSE:PD)

CONTENTS

Syntax
Description
Options
Returns
Example
Author
License

SYNTAX

function lookfor(basename,env) result(pathname)

   character(len=:),intent(in)  :: basename
   character(len=:),intent(in)  :: env
   character(len=:),allocatable :: pathname

DESCRIPTION

Given a base filename find the first file with that name in the directories specified by the environment variable ENV

OPTIONS

BASENAME
  the file to search for
ENV environment variable name. Seperator between directory names is assumed to be a colon on ULS (Unix-Like Systems) and semi-colon on MS-Windows machines.

RETURNS

PATHNAME
  the first pathname found in the current user path. Returns blank if the file is not found.

EXAMPLE

Sample program:

    program demo_lookfor
    use M_io, only : lookfor
    implicit none
    character(len=:),allocatable :: returned
       returned=lookfor(’ls’,’PATH’)
       write(*,*)’ls is ’,returned
       returned=lookfor(’dir.exe’,’PATH’)
       write(*,*)’dir is ’,returned
    end program demo_lookfor

AUTHOR

John S. Urban

LICENSE

Public Domain


lookfor (3) March 11, 2021
Generated by manServer 1.08 from b362c4e0-396e-48e5-81ac-dd7a6eb92ee0 using man macros.