TSINSTALLDIRGET(3ts)
π TSINSTALLDIRGET π
okay bestie, so this is a page from the Apache Traffic Server manual, section 3ts β it's the TSInstallDirGet(3ts) one, and it's literally just about asking Traffic Server "hey where do you live?" π β¨ Four little functions, four little paths, no cap.
β¨ 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 π¦
So here's the vibe. TSInstallDirGet() hands you back the path to the root of the Traffic Server installation β like, the whole entire thing, top to bottom. π
And then the other three are the glow-ups that give you the complete, absolute path to their specific little corners of the world:
TSConfigDirGet()β the configuration directory πTSPluginDirGet()β the plugin installation directory πTSRuntimeDirGet()β the runtime directory πβοΈ
respectively, obviously. one for each. they ate. π
π RETURN VALUES π
All four of these functions return a NUL-terminated string β and listen, this is the important part, bestie:
You must not modify it and you must not free it. π« It's not yours, it's theirs. Hands off. π
π EXAMPLES π
Say you wanna load a file that lives in the Traffic Server configuration directory. Iconic. Here's how:
#include <ts/ts.h>
#include <stdio.h>
char * path;
asprintf(&path, "%s/example.conf", TSConfigDirGet());
see how TSConfigDirGet() just slots right in there with a %s? chef's kiss. π©π³π
π₯ SEE ALSO π₯
TSAPI(3ts)β go read that one too, iykyk π«Ά
π COPYRIGHT π
2026, dev@trafficserver.apache.org
okay that's the whole page, you're so welcome π and just so you know, this was version 9.2, dated Feb 12, 2026 β so yeah, freshly stamped, absolutely slaying, periodt. π bye bestie!! πβ¨π¦
π¦ where this page comes from
- ubuntu noble: trafficserver-dev 9.2.3+ds-1+deb12u1ubuntu0.1 Β· Apache-2.0
- ubuntu questing: trafficserver-dev 9.2.5+ds-1ubuntu2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms