MCPcopy Create free account
hub / github.com/cloudflare/computer / writeFileSync

Method writeFileSync

packages/dofs/src/provider.ts:409–420  ·  view source on GitHub ↗
(
    path: string,
    data: string | Buffer,
    options?: { encoding?: BufferEncoding; mode?: number } | BufferEncoding,
  )

Source from the content-addressed store, hash-verified

407 }
408
409 writeFileSync(
410 path: string,
411 data: string | Buffer,
412 options?: { encoding?: BufferEncoding; mode?: number } | BufferEncoding,
413 ): void {
414 const mode = typeof options === "string" ? undefined : options?.mode;
415 const bytes =
416 typeof data === "string"
417 ? new TextEncoder().encode(data)
418 : new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
419 writeFileSyncImpl(this.db, path, bytes, { mode }, this.now);
420 }
421
422 writeFileRangesSync(
423 path: string,

Callers 15

writeFileMethod · 0.95
provider.test.tsFile · 0.80
setupFunction · 0.80
buildChainFileFunction · 0.80
buildWideFunction · 0.80
fs-ops.bench.tsFile · 0.80
createAllFunction · 0.80
reconcileDiskToVfsFunction · 0.80
shim.test.tsFile · 0.80
vfs.test.tsFile · 0.80

Calls

no outgoing calls

Tested by 2

setupFunction · 0.64
getFunction · 0.64