TSINSTALLDIRGET(3ts)

πŸ“¦
version 9.2.5 Β· 4 versions
, in ubuntu noble, ubuntu questing

πŸ’– 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 🫢

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