---
name: "TSInstallDirGet"
section: "3ts"
platform: "linux"
package: "trafficserver-dev"
version: "9.2.5+ds-0+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/TSInstallDirGet"
---

# TSInstallDirGet(3ts)

return Traffic Server installation directories

## NAME

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:

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

## SEE ALSO

**[TSAPI(3ts)](/TSAPI/3ts.md)**

## COPYRIGHT

2026, dev@trafficserver.apache.org
