file_find_in_path_c
status.i4.v = file_find_in_path_c(file_name.i1a.r, path_type.i4.v,
path.i1a.r, found_file_name.i1a.r
[,options.u4.v]
[,path_separator.i1.v])
This routine will determine whether a file name points to an
existing file.
file_name file name to find
path_type type of path provided
(FILE_PATH_LITERAL -> use the passed path string as is,
FILE_PATH_ENV_VARIABLE -> treat the passed path as
an environment variable)
path path string to be interpreted using "path_type"
found_file_name returned matching file name (if found)
[options] search options
(FILE_FIND_OPT_NONE -> no options selected,
FILE_FIND_OPT_CHECK_PWD -> always check the present
directory first)
[path_separator] path entry separator character (defaults to ':')
This function returns ACNET status values as follows:
CLIB_OK file found
CLIB_INVARG invalid path type requested
CLIB_NO_SUCH file not found in path
This function requires the following include files:
cbslib_h, acnet_errors_h
Related functions:
file_exists_c, file_name_parse_c, file_name_expand_c, file_view_find,
file_num_lines, file_view_read, file_view_select
C/C++ usage:
static const char file_name[] = "file_name.ext";
static const char path[] = "some_path";
char found_file_name[256];
char path_separator = ':';
int status;
int path_type = FILE_PATH_ENV_VARIABLE;
unsigned int options = FILE_FIND_OPT_CHECK_PWD;
status = file_find_in_path_c(file_name,path_type,path,found_file_name,
options,path_separator);