MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / GetTempFolder

Function GetTempFolder

Source/Common/FEXServerClient.cpp:84–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84fextl::string GetTempFolder() {
85 const std::array<const char*, 5> Vars = {
86 "XDG_RUNTIME_DIR", "TMPDIR", "TMP", "TEMP", "TEMPDIR",
87 };
88
89 for (auto& Var : Vars) {
90 auto Path = getenv(Var);
91 if (Path) {
92 // If one of the env variable-driven paths works then use that.
93 return Path;
94 }
95 }
96
97 // Fallback to `/tmp/` if no env vars are set.
98 // Might not be ideal but we don't have much of a choice.
99 return fextl::string {"/tmp"};
100}
101
102fextl::string GetServerMountFolder() {
103 // We need a FEXServer mount directory that has some tricky requirements.

Callers 3

GetServerMountFolderFunction · 0.85
GetServerSocketPathFunction · 0.85
OpenListenSocketMethod · 0.85

Calls 1

getenvFunction · 0.85

Tested by

no test coverage detected