MCPcopy Create free account
hub / github.com/Noumena-Network/code / writeFileAndFlush

Function writeFileAndFlush

src/components/agents/agentFileUtils.ts:325–337  ·  view source on GitHub ↗
(
  filePath: string,
  content: string,
  flag: 'w' | 'wx' = 'w',
)

Source from the content-addressed store, hash-verified

323}
324
325async function writeFileAndFlush(
326 filePath: string,
327 content: string,
328 flag: 'w' | 'wx' = 'w',
329): Promise<void> {
330 const handle = await open(filePath, flag)
331 try {
332 await handle.writeFile(content, { encoding: 'utf-8' })
333 await handle.datasync()
334 } finally {
335 await handle.close()
336 }
337}

Callers 2

saveAgentToFileFunction · 0.85
updateAgentFileFunction · 0.85

Calls 2

openFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected