(db: Database, inode: number, idx: number)
| 375 | } |
| 376 | |
| 377 | function readChunkBytes(db: Database, inode: number, idx: number): Uint8Array { |
| 378 | const chunk = db.one<{ hash: Uint8Array }>( |
| 379 | "SELECT hash FROM vfs_chunks WHERE inode = ? AND idx = ?", |
| 380 | inode, |
| 381 | idx, |
| 382 | ); |
| 383 | if (chunk === undefined) return new Uint8Array(); |
| 384 | const bytes = getBlobBytes(db, chunk.hash); |
| 385 | if (bytes === undefined) { |
| 386 | throw createWorkspaceError("EIO", "missing blob bytes"); |
| 387 | } |
| 388 | return bytes; |
| 389 | } |
| 390 | |
| 391 | function resolveFileInode(db: Database, path: string): { inode: number; mode: number } { |
| 392 | const { path: canonical } = canonicalizePath(path); |
no test coverage detected