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

Function ftruncate

test/parallel/test-trace-events-fs-async.js:106–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104}
105
106function ftruncate() {
107 const fs = require('fs');
108 fs.writeFileSync('fs10.txt', '123', 'utf8');
109 const fd = fs.openSync('fs10.txt', 'r+');
110 fs.ftruncate(fd, 1, () => {
111 fs.unlinkSync('fs10.txt');
112 });
113}
114
115function futime() {
116 const fs = require('fs');

Callers

nothing calls this directly

Calls 5

ftruncateMethod · 0.80
requireFunction · 0.50
writeFileSyncMethod · 0.45
openSyncMethod · 0.45
unlinkSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…