MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / th_mktempdir

Function th_mktempdir

tests/test_helpers.h:134–148  ·  view source on GitHub ↗

Create a temporary directory. Returns static buffer with path. * Pattern: prefix is used as part of the dirname. */

Source from the content-addressed store, hash-verified

132/* Create a temporary directory. Returns static buffer with path.
133 * Pattern: prefix is used as part of the dirname. */
134static inline char *th_mktempdir(const char *prefix) {
135 static char buf[256];
136#ifdef _WIN32
137 const char *tmp = getenv("TEMP");
138 if (!tmp) tmp = getenv("TMP");
139 if (!tmp) tmp = "C:\\Temp";
140 snprintf(buf, sizeof(buf), "%s\\%s_XXXXXX", tmp, prefix);
141#else
142 snprintf(buf, sizeof(buf), "/tmp/%s_XXXXXX", prefix);
143#endif
144 if (!cbm_mkdtemp(buf)) {
145 return NULL;
146 }
147 return buf;
148}
149
150/* ── File permissions (no-op on Windows) ──────────────────────── */
151

Callers 6

test_git_context.cFile · 0.85
ui_delete_fixture_initFunction · 0.85
test_httpd.cFile · 0.85
test_pipeline.cFile · 0.85
test_discover.cFile · 0.85

Calls 1

cbm_mkdtempFunction · 0.85

Tested by

no test coverage detected