MCPcopy
hub / github.com/codeaashu/claude-code / writeFileAndFlush

Function writeFileAndFlush

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

Source from the content-addressed store, hash-verified

258}
259
260async function writeFileAndFlush(
261 filePath: string,
262 content: string,
263 flag: 'w' | 'wx' = 'w',
264): Promise<void> {
265 const handle = await open(filePath, flag)
266 try {
267 await handle.writeFile(content, { encoding: 'utf-8' })
268 await handle.datasync()
269 } finally {
270 await handle.close()
271 }
272}
273

Callers 2

saveAgentToFileFunction · 0.85
updateAgentFileFunction · 0.85

Calls 2

openFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected