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

Function write_bytes_file

tests/test_discover.c:2126–2134  ·  view source on GitHub ↗

Write raw bytes (may contain embedded NUL) to base/rel. Parent must exist. */

Source from the content-addressed store, hash-verified

2124
2125/* Write raw bytes (may contain embedded NUL) to base/rel. Parent must exist. */
2126static int write_bytes_file(const char *path, const void *data, size_t n) {
2127 FILE *f = cbm_fopen(path, "wb");
2128 if (!f) {
2129 return -1;
2130 }
2131 size_t w = fwrite(data, 1, n, f);
2132 fclose(f);
2133 return w == n ? 0 : -1;
2134}
2135
2136/* Discover a single file with the given first-line content and report the
2137 * language it was classified as via *out_lang (CBM_LANG_COUNT if unindexed).

Callers 1

test_discover.cFile · 0.85

Calls 2

cbm_fopenFunction · 0.85
fwriteFunction · 0.85

Tested by

no test coverage detected