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

Method ftruncate

lib/internal/vfs/file_system.js:923–934  ·  view source on GitHub ↗

* Truncates a file descriptor asynchronously. * @param {number} fd The file descriptor * @param {number|Function} [len] The new length or callback * @param {Function} [callback] Callback (err)

(fd, len, callback)

Source from the content-addressed store, hash-verified

921 * @param {Function} [callback] Callback (err)
922 */
923 ftruncate(fd, len, callback) {
924 if (typeof len === 'function') {
925 callback = len;
926 len = 0;
927 }
928 try {
929 this.ftruncateSync(fd, len);
930 process.nextTick(callback, null);
931 } catch (err) {
932 process.nextTick(callback, err);
933 }
934 }
935
936 /**
937 * Creates a hard link asynchronously.

Callers 11

truncateFunction · 0.80
ftruncateFunction · 0.80
ftruncateSyncFunction · 0.80
truncateMethod · 0.80
ftruncateFunction · 0.80
ftruncateFunction · 0.80
testFtruncateFunction · 0.80

Calls 1

ftruncateSyncMethod · 0.95

Tested by

no test coverage detected