MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / readUtf8TextFile

Function readUtf8TextFile

apps/desktop/src/main/workspace-reader.ts:340–347  ·  view source on GitHub ↗
(abs: string)

Source from the content-addressed store, hash-verified

338}
339
340async function readUtf8TextFile(abs: string): Promise<string> {
341 const bytes = await readFile(abs);
342 const content = UTF8_DECODER.decode(bytes);
343 if (content.indexOf('\u0000') !== -1) {
344 throw new Error('binary file contains NUL byte');
345 }
346 return content;
347}
348
349/**
350 * Recursively list all files under `root`, returning metadata only (path,

Callers 2

walkFunction · 0.85
readWorkspaceFileAtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected