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

Function pf_file_is

tests/test_pipeline_frozen.c:85–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 return cbm_path_info_utf8(path, &info) == CBM_PATH_INFO_ABSENT;
84}
85static bool pf_file_is(const char *path, const char *text) {
86 char data[4096];
87 size_t len = strlen(text);
88 if (len >= sizeof(data))
89 return false;
90 FILE *file = cbm_fopen(path, "rb");
91 if (!file)
92 return false;
93 size_t n = fread(data, 1, len + 1, file);
94 bool ok = n == len && !memcmp(data, text, len) && !ferror(file);
95 return fclose(file) == 0 && ok;
96}
97static bool pf_files_equal(const char *a, const char *b) {
98 FILE *left = cbm_fopen(a, "rb"), *right = cbm_fopen(b, "rb");
99 bool ok = left && right;

Callers 4

pf_sidecar_refusalFunction · 0.85
pf_path_refusalFunction · 0.85

Calls 2

cbm_fopenFunction · 0.85
freadFunction · 0.85

Tested by

no test coverage detected