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

Function open

packages/computerd/src/fuse/driver.ts:509–528  ·  view source on GitHub ↗
(path, _flags, cb)

Source from the content-addressed store, hash-verified

507 },
508
509 open(path, _flags, cb) {
510 try {
511 const entry = files.get(path);
512 if (entry?.pendingCreate === true) {
513 cb(0, openFileHandle(path));
514 return;
515 }
516 const stat = vfs.statSync(toVfs(path));
517 if (stat.isDirectory()) {
518 cb(ERRNO.EISDIR, 0);
519 return;
520 }
521 if (hasBufferedWrites) {
522 directWriteVfs.openWriteBufferSync?.(toVfs(path));
523 }
524 cb(0, openFileHandle(path));
525 } catch (error) {
526 cb(toErrno(error), 0);
527 }
528 },
529
530 opendir(path, _flags, cb) {
531 try {

Callers

nothing calls this directly

Calls 7

openFileHandleFunction · 0.85
toVfsFunction · 0.85
toErrnoFunction · 0.85
statSyncMethod · 0.80
openWriteBufferSyncMethod · 0.80
getMethod · 0.65
isDirectoryMethod · 0.65

Tested by

no test coverage detected