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.

DataRootDirectory (string): The directory used by the 1E Client for general data storage. New in v8.1.

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

This is derived from either the configuration value if the specified setting is valid, or the default temporary directory.

The following table shows the OS-specific defaults used if the setting is omitted, blank, or invalid. The default is recommended.

PlatformEnvironment Variable(s)
Default
Windows

TMP
TEMP

%windir%\Temp which is the default %TEMP% location for SYSTEM.
LinuxTMPDIR/tmp

TemporaryDirectory is a configuration setting of the 1E Client introduced in a v5.0 hotfix.

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.