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

Method readSync

lib/internal/vfs/file_system.js:602–608  ·  view source on GitHub ↗

* Reads from a file descriptor synchronously. * @param {number} fd The file descriptor * @param {Buffer} buffer The buffer to read into * @param {number} offset The offset in the buffer * @param {number} length The number of bytes to read * @param {number|null} position The position i

(fd, buffer, offset, length, position)

Source from the content-addressed store, hash-verified

600 * @returns {number} The number of bytes read
601 */
602 readSync(fd, buffer, offset, length, position) {
603 const vfd = getVirtualFd(fd);
604 if (!vfd) {
605 throw createEBADF('read');
606 }
607 return vfd.entry.readSync(buffer, offset, length, position);
608 }
609
610 /**
611 * Writes to a file descriptor synchronously.

Callers

nothing calls this directly

Calls 2

getVirtualFdFunction · 0.85
createEBADFFunction · 0.85

Tested by

no test coverage detected