SYS_IniFileOpen Function

Action

Opens an initialization (.ini) file on the target machine.

Syntax

hIniFile = SYS_IniFileOpen (sFile [, ftType])
Variable Description
hIniFile A handle to the file. HINIFILE.
sFile The name of the file to open. STRING.
ftType Optional. Specifies the format of the .ini file to be created. Only has an effect when creating a new file. FILETYPE.

Notes

SYS_IniFileOpen returns a handle to the initialization file, of type HINIFILE. You use this handle when referring to the file with IniFileGetValue, IniFileSetValue, and IniFileClose, or the SYS_ equivalent functions. Applications typically store information in initialization files. For example, Silk Test Classic stores information in the initialization file partner.ini.

If the specified file does not exist, SYS_IniFileOpen does not actually create the file. The file is created when SYS_IniFileClose or IniFileClose is invoked and a value is set by either IniFileSetValue or SYS_IniFileSetValue.

SYS_IniFileOpen is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

When the Agent disconnects, any open files are closed and saved, but we strongly encourage you to use SYS_FileClose() when you are finished with a file. Any open files are automatically closed and saved at the end of a test script as well.

This function is not designed for local access.

Example

HINIFILE hIni
hIni = SYS_IniFileOpen ("myapp.ini")