Function to scan a set of directories for a given file
Location in HEALPix directory tree:
directories, filename, fullpath
||contains the set of directories (up to 20), separated by an ASCII
character of value < 32 (see concatnl). During the
search, it is assumed that the
given directories and filename can be separated by nothing,
a / (slash) or a (backslash)
||the file to be found.
||returns the full path to the first occurrence of the
file among the directories provided. Empty if the file is not
found. The search is not recursive.
||set to true if the file is found, to false otherwise.
character(len=filenamelen) :: dirs, full
logical(lgt) :: found
dirs = concatnl('dir1','/dir2','/dir2/subdir1/') ! build directories list.
found = scan_directories(dirs, 'myfile', full) ! do the search
if (found) print*,trim(full)
Search for 'myfile' in the directories 'dir1', '/dir2', '/dir2/subdir1/'
This section lists the routines related to scan_directories
- parse an ASCII file for parameters definition
- concatenates a set of substrings into one string, interspaced
with LineFeed character