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

Function test_mkdirp

tests/test_cli.c:49–60  ·  view source on GitHub ↗

Helper: mkdirp */

Source from the content-addressed store, hash-verified

47
48/* Helper: mkdirp */
49static int test_mkdirp(const char *path) {
50 char tmp[1024];
51 snprintf(tmp, sizeof(tmp), "%s", path);
52 for (char *p = tmp + 1; *p; p++) {
53 if (*p == '/') {
54 *p = '\0';
55 cbm_mkdir(tmp);
56 *p = '/';
57 }
58 }
59 return cbm_mkdir(tmp) == 0 || errno == EEXIST ? 0 : -1;
60}
61
62/* Helper: recursive remove */
63static void test_rmdir_r(const char *path) {

Callers 1

test_cli.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected