Findsuitablefile() - IBM Prerequisite Scanner User Manual

Table of Contents

Advertisement

Syntax
findNewest(arr)
Input parameters
Array arr
Return values
String result

findSuitableFile()

Finds the relevant configuration file for a product and version.
Purpose
This function calls the "getFirstMatch()" on page 121 function to get the set of files
that has the extension input parameter as the file extension from the list of files
returned by the "allFiles()" on page 114 function. It then calls the "getFirstMatch()"
on page 121 function again to return the set of files that contains the product code
input parameter in the file name. It calls the same function to get the set of files
that contains the version input parameter in the file name. If the functions finds
one or more file matches for the version, it calls the "findNewest()" on page 118
function to get the latest version of that file and returns that file name; otherwise,
it returns common.bat file or uses the logScreen and logWarning sub routines before
returning the latest version of the configuration file for the product code.
Syntax
findSuitableFile(pd,version,suf,filepath)
Input parameters
String pd
String version
String suf
String filepath
Return values
String findSuitableFile
Contains the set of configuration files to check.
Returns the name of the latest configuration file.
The product code associated with the file to find, as specified in the product
code file, ips_root/codename.cfg file.
The version of the product associated with the file to find. <version> is the
8-digit code to represent the version, release, modification and level, with two
digits for each part of the code; for example, 7.3.21 is 07032100.
The extension for the type of file to find, such as cfg or bat.
The path to the directory that contains the file to find.
Returns one of the following file names depending upon the results of called
functions:
v pd_version.cfg, the latest version of the file for the associated product code
and version.
v common.bat if the value for the file extension input parameter is bat.
Appendix E. Common functions for Windows systems
119

Advertisement

Table of Contents
loading

Table of Contents