Version: 14
restore

Contents

Method

GetKeyFiles

ModuleAgent
LibraryCore
Action

Returns names and paths of key files relating to the execution of the Tachyon Agent.

Parameters(None)
Return values

Configuration (string): The full path of the file used to configure the Tachyon Agent.

Executable (string): The full path of the executable file corresponding to the running Tachyon Agent.

Log (string): The full path of the Tachyon Agent log file.

TemporaryDirectory (string): The directory actually used by the 1E Client for temporary files and directories.

This is derived from the configuration value if it was specified, not the value itself, or is derived from the default temporary directory if there was no configuration or the configured value is invalid.

Available in v5.1 or hotfixed v5.0.

Example

The following example reads the Tachyon Agent configuration file and shows the contained settings and values:

@keyFiles = Agent.GetKeyFiles();

/* Bail if the Agent has no configuration file (see Notes below) */
SELECT * FROM @keyFiles WHERE Configuration != "";
EVALUATE;

/* Read each line of configuration file */
@lines = FileSystem.GetFileByLine(FileName: @keyFiles.Configuration);

/* Filter out comment entries, and parse remaining lines into Setting and Value */
SELECT LTRIM(REGEXPREPLACE("([^=]*)=(.*)", Content, "$1")) AS Setting
,      LTRIM(REGEXPREPLACE("([^=]*)=(.*)", Content, "$2")) AS Value
FROM   @lines
WHERE  LTRIM(Content) REGEXP "([^\\#])*=(.*)";

Uses ECMA262 format for regular expressions:

Platforms
  • Windows
  • Linux
  • MacOS
  • Solaris Intel
  • Solaris Sparc
  • Android
Notes

Although this method is supported on Android devices, only the Executable and TemporaryDirectory fields will have a value. The Configuration and Log fields will be empty. This is because Tachyon Agents running on Android devices are configured via the Application Preferences interface (not based on a configuration file), and log directly to the Android sub-system.