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

Function insertFileDirent

packages/dofs/src/fs/writeFile.ts:279–293  ·  view source on GitHub ↗
(
  db: Database,
  parentInode: number,
  leafName: string,
  childInode: number,
  canonicalPath: string,
)

Source from the content-addressed store, hash-verified

277// existing inode and dirent, so its resolution is unchanged). A new
278// file is a leaf with no descendants, so exact invalidation suffices.
279function insertFileDirent(
280 db: Database,
281 parentInode: number,
282 leafName: string,
283 childInode: number,
284 canonicalPath: string,
285): void {
286 db.run(
287 "INSERT INTO vfs_dirents (parent_inode, name, child_inode) VALUES (?, ?, ?)",
288 parentInode,
289 leafName,
290 childInode,
291 );
292 invalidateResolveExact(db, canonicalPath);
293}
294
295function insertFileNode(db: Database, mode: number, mtime: number): number {
296 const row = db.one<{ inode: number }>(

Callers 5

writeFileStreamingFunction · 0.85
createFileSyncFunction · 0.85
commitPendingBufferFunction · 0.85
writeFileSyncFunction · 0.85
writeFileRangesSyncFunction · 0.85

Calls 2

invalidateResolveExactFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected