MCPcopy Index your code
hub / github.com/nodejs/node / tryReadSync

Function tryReadSync

lib/fs.js:473–483  ·  view source on GitHub ↗
(fd, isUserFd, buffer, pos, len)

Source from the content-addressed store, hash-verified

471}
472
473function tryReadSync(fd, isUserFd, buffer, pos, len) {
474 let threw = true;
475 let bytesRead;
476 try {
477 bytesRead = fs.readSync(fd, buffer, pos, len);
478 threw = false;
479 } finally {
480 if (threw && !isUserFd) fs.closeSync(fd);
481 }
482 return bytesRead;
483}
484
485function tryReadSyncWithUserBuffer(fd, isUserFd, buffer, byteLengthName) {
486 let pos = 0;

Callers 2

readFileSyncFunction · 0.85

Calls 2

readSyncMethod · 0.45
closeSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…