GetDataFilePath Function

Action

This method returns the absolute path to a file in the data files section of a load-test script. As there are different locations for the data files depending on where the load-test is executed (localhost or agent) this function always returns the absolute path to a data file.

Include file

Kernel.bdh

Syntax

GetDataFilePath( in  sDataFile  : string,
                 out sPath      : string,
                 in  nSize      : number optional ): boolean;

Return value

  • true if successfully

  • false otherwise

Parameter Description
sDataFile Name of the data file of which the absolute path should be returned.
sPath String buffer that will receive the absolute path of the file.
nSize Size of the string buffer passed in sPath (optional).

Example

dcltrans
  transaction TMain
  var
    sPath : string;
    hFile : number;
  begin
    GetDataFilePath("testdata.txt", sPath);
    FileCSVLoad(hFile, sPath, ",");
    ...
  end TMain;