MCPcopy
hub / github.com/jvilk/BrowserFS / openFileSync

Method openFileSync

src/generic/key_value_filesystem.ts:369–377  ·  view source on GitHub ↗
(p: string, flag: FileFlag)

Source from the content-addressed store, hash-verified

367 }
368
369 public openFileSync(p: string, flag: FileFlag): File {
370 const tx = this.store.beginTransaction('readonly'),
371 node = this.findINode(tx, p),
372 data = tx.get(node.id);
373 if (data === undefined) {
374 throw ApiError.ENOENT(p);
375 }
376 return new SyncKeyValueFile(this, p, flag, node.toStats(), data);
377 }
378
379 public unlinkSync(p: string): void {
380 this.removeEntry(p, false);

Callers

nothing calls this directly

Calls 5

findINodeMethod · 0.95
ENOENTMethod · 0.80
toStatsMethod · 0.80
beginTransactionMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected