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

Method ftruncateSync

lib/internal/vfs/file_system.js:480–486  ·  view source on GitHub ↗

* Truncates a file descriptor synchronously. * @param {number} fd The file descriptor * @param {number} [len] The new length

(fd, len = 0)

Source from the content-addressed store, hash-verified

478 * @param {number} [len] The new length
479 */
480 ftruncateSync(fd, len = 0) {
481 const vfd = getVirtualFd(fd);
482 if (!vfd) {
483 throw createEBADF('ftruncate');
484 }
485 vfd.entry.truncateSync(len);
486 }
487
488 /**
489 * Creates a hard link synchronously.

Callers 12

ftruncateMethod · 0.95
truncateSyncFunction · 0.80
ftruncateSyncFunction · 0.80
truncateSyncMethod · 0.80
mainFunction · 0.80

Calls 3

getVirtualFdFunction · 0.85
createEBADFFunction · 0.85
truncateSyncMethod · 0.45

Tested by

no test coverage detected