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

Method createFileSync

src/generic/key_value_filesystem.ts:361–367  ·  view source on GitHub ↗
(p: string, flag: FileFlag, mode: number)

Source from the content-addressed store, hash-verified

359 }
360
361 public createFileSync(p: string, flag: FileFlag, mode: number): File {
362 const tx = this.store.beginTransaction('readwrite'),
363 data = emptyBuffer(),
364 newFile = this.commitNewFile(tx, p, FileType.FILE, mode, data);
365 // Open the file.
366 return new SyncKeyValueFile(this, p, flag, newFile.toStats(), data);
367 }
368
369 public openFileSync(p: string, flag: FileFlag): File {
370 const tx = this.store.beginTransaction('readonly'),

Callers

nothing calls this directly

Calls 4

commitNewFileMethod · 0.95
emptyBufferFunction · 0.90
toStatsMethod · 0.80
beginTransactionMethod · 0.65

Tested by

no test coverage detected