GetDirectory Function

Action

Retrieves the directory where specified types of Silk Performer files are located. Do not use GetDirectory to locate data files that are referenced by the project. Use the function GetDataFilePath instead.

Include file

Kernel.bdh

Syntax

GetDirectory( in  nDirectory : number,
              out sDir       : string,
              in  nDirSize   : number optional );
Parameter Description
nDirectory

Specifies which directory setting to retrieve. This parameter can be one of the following flags:

  • DIRECTORY_HOME. Retrieves the Silk Performer home directory.

  • DIRECTORY_SOURCE. Retrieves the default directory for opening and saving load-test scripts.

  • DIRECTORY_RESULT. Retrieves the directory where all result files are saved.

  • DIRECTORY_INCLUDE. Retrieves the directory where all include files are located.

  • DIRECTORY_CUSTOM_INCLUDE. Retrieves the directory where all the custom include files are located.

  • DIRECTORY_DATA. Retrieves the directory where all user data files, certificate files and random data files are located.

  • DIRECTORY_CUSTOM_DATA. Retrieves the directory where all custom user data files, certificate files and random data files are located.

  • DIRECTORY_PROJECT. Retrieves the directory where the project file is located. This location is different on controller and agent machine.

  • DIRECTORY_TEMP. Retrieves the directory where temporary files can be stored during a load test. This directory will be automatically deleted after the test run.

Note: Agent computers create temporary directories for load test execution. Only the parameters DIRECTORY_HOME, DIRECTORY_SOURCE, and DIRECTORY_INCLUDE will return the same results from an agent as from the controller computer.
sDir String receiving the directory.
nDirSize Number of characters to copy into sDir. (optional, default is STRING_COMPLETE)

Example

dcltrans
  transaction TMain
  var
    sDirectory: string;
  begin
    GetDirectory(DIRECTORY_HOME, sDirectory);
    writeln(sDirectory),
  end TMain;