TSInstallDirGet

Return Traffic Server installation directories.

Synopsis

include <ts/ts.h>

const char * TSInstallDirGet(void)

const char * TSConfigDirGet(void)

const char * TSPluginDirGet(void)

const char * TSRuntimeDirGet(void)

Description

TSInstallDirGet() returns the path to the root of the Traffic Server installation. TSConfigDirGet(), TSPluginDirGet() and TSRuntimeDirGet() return the complete, absolute path to the configuration directory, the plugin installation directory and the runtime directory, respectively.

Return Values

These functions all return a NUL-terminated string that must not be modified or freed.

Examples

To load a file that is located in the Traffic Server configuration directory:

  1. #include <ts/ts.h>
  2. #include <stdio.h>
  3. char * path;
  4. asprintf(&path, "%s/example.conf", TSConfigDirGet());

See Slso

TSAPI(3ts)