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

Method openSync

src/backend/Emscripten.ts:257–268  ·  view source on GitHub ↗
(p: string, flag: FileFlag, mode: number)

Source from the content-addressed store, hash-verified

255 }
256
257 public openSync(p: string, flag: FileFlag, mode: number): EmscriptenFile {
258 try {
259 const stream = this._FS.open(p, flag.getFlagString(), mode);
260 if (this._FS.isDir(stream.node.mode)) {
261 this._FS.close(stream);
262 throw ApiError.EISDIR(p);
263 }
264 return new EmscriptenFile(this, this._FS, p, stream);
265 } catch (e) {
266 throw convertError(e, p);
267 }
268 }
269
270 public unlinkSync(p: string): void {
271 try {

Callers

nothing calls this directly

Calls 6

getFlagStringMethod · 0.80
EISDIRMethod · 0.80
convertErrorFunction · 0.70
openMethod · 0.65
isDirMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected