2.4.5 CFSRCH

1.
Functions
Searches for an existing file name from a combination of the list of header and tail of the pathname.
2.
Call
CFSRCH(CPL,NP,CFL,NF,CFN)
3.
Explanation of Parameters
CPL (C(NP)*80) List of the header of a pathname. Character-type arrays with lengths of 80 characters
NP (I) Length of array CPL
CFL (C(NF)*80) List of the tail of a pathname with lengths of 80 characters
NF (I) Length of array CFL
CFN (C*(*)) Character-type variable that returns the first file name found
4.
Notes
(a)
For example, in the file name /usr/local/bin/dclfrt, the header refers to the  /usr/local/bin/ portion and the tail to the  dclfrt portion.
(b)
This subroutine checks whether a file exists with a pathname consisting of a combination of the header from CPL(1) to CPL(NP), and the tail from CFL(1) to CFL(NF), and returns the file name of the first file found. If no such file exists, it returns a blank character string.
(c)
If blank character strings are given as the header of pathnames, it will search for a file with the tail of the pathnames in the current directory.
(d)
This routine is system-dependent. The CFSRCH is created with a tree-structured file system, such as for the UNIX, in mind, and so it is necessary to define another set of rules for file- name search for mainframe systems. However, internally, the present routine just checks for the existence of files using a combination of two character-type lists, so if the definition for "header" and "tail" is ignored and considered only as components of a file name, this routine can be used in mainframe structures as well. However, in such a case, there is the specification that "header of pathnames given by blanks specify a search in the current directory," so blanks should not be specified, or there is a need to additionally define operation when blanks are used (for example, to do nothing).