The path of data file name: name itself if it exists (a path, or a
file in the current directory), else the first match in the directories
of the VKFRAMES_DATA_PATH environment variable; '' if not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
a path, or a file name |
function find_data_file(name) result(path) character(len=*), intent(in) :: name !! a path, or a file name character(len=:), allocatable :: path character(len=4096) :: env integer :: status logical :: exists path = '' if (len_trim(name) == 0) return inquire(file=trim(name), exist=exists) if (exists) then path = trim(name) return end if call get_environment_variable('VKFRAMES_DATA_PATH', env, status=status) if (status == 0) path = find_in_dirs(trim(name), trim(env)) end function find_data_file