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

Function ftruncateSync

lib/fs.js:1344–1354  ·  view source on GitHub ↗

* Synchronously truncates the file descriptor. * @param {number} fd * @param {number} [len] * @returns {void}

(fd, len = 0)

Source from the content-addressed store, hash-verified

1342 * @returns {void}
1343 */
1344function ftruncateSync(fd, len = 0) {
1345 validateInteger(len, 'len');
1346
1347 const h = vfsState.handlers;
1348 if (h !== null) {
1349 const result = h.ftruncateSync(fd, len < 0 ? 0 : len);
1350 if (result !== undefined) return;
1351 }
1352
1353 binding.ftruncate(fd, len < 0 ? 0 : len);
1354}
1355
1356function lazyLoadCp() {
1357 if (cpFn === undefined) {

Callers

nothing calls this directly

Calls 2

ftruncateSyncMethod · 0.80
ftruncateMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…