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

Function writeAt

packages/computer/src/assets/index.test.ts:92–96  ·  view source on GitHub ↗
(ws: Workspace, path: string, bytes: Uint8Array)

Source from the content-addressed store, hash-verified

90// writeFile requires the parent directory to exist; create it then
91// write the bytes.
92async function writeAt(ws: Workspace, path: string, bytes: Uint8Array): Promise<void> {
93 const dir = path.slice(0, path.lastIndexOf("/"));
94 if (dir.length > 0) await ws.fs.mkdir(dir, { recursive: true });
95 await ws.fs.writeFile(path, bytes);
96}
97
98const fixedClock = () => Date.UTC(2026, 0, 2, 3, 4, 5);
99

Callers 1

index.test.tsFile · 0.85

Calls 2

mkdirMethod · 0.65
writeFileMethod · 0.65

Tested by

no test coverage detected