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

Function parentAndNameForResolvedPath

packages/dofs/src/fs/writeFile.ts:412–418  ·  view source on GitHub ↗
(db: Database, path: string)

Source from the content-addressed store, hash-verified

410}
411
412function parentAndNameForResolvedPath(db: Database, path: string): [number, string] {
413 const { parts, path: canonical } = canonicalizePath(path);
414 if (parts.length === 0) {
415 throw createWorkspaceError("EISDIR", "cannot write to the root directory", canonical);
416 }
417 return [resolveParent(db, parts, canonical), parts[parts.length - 1]];
418}
419
420// Update an inode's chunk-backed representation in place. Iterates over
421// the full chunk grid but only touches `vfs_chunks` rows whose contents

Callers 3

resolveFileInodeFunction · 0.85
createFileSyncFunction · 0.85

Calls 3

canonicalizePathFunction · 0.85
resolveParentFunction · 0.70
createWorkspaceErrorFunction · 0.50

Tested by

no test coverage detected