|
scan_directories
Function to scan a set of directories for a given file
Location in HEALPix directory tree:
src/f90/mod/paramfile_io.F90
FORMAT var=scan_directories(
directories, filename, fullpath
)
ARGUMENTS
name&dimensionality |
kind |
in/out |
description |
|
|
|
|
directories |
CHR |
IN |
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) |
filename |
CHR |
IN |
the file to be found. |
fullpath |
CHR |
OUT |
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. |
var |
LGT |
OUT |
set to true if the file is found, to false otherwise. |
EXAMPLE:
use paramfile_io
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/'
RELATED ROUTINESThis section lists the routines related to scan_directories
-
parse_xxx
- parse an ASCII file for parameters definition
-
concatnl
- concatenates a set of substrings into one string, interspaced
with LineFeed character
Eric Hivon
2010-06-18
|
|