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

Method fstat

lib/internal/vfs/file_system.js:882–896  ·  view source on GitHub ↗

* Gets file stats from a file descriptor asynchronously. * @param {number} fd The file descriptor * @param {object|Function} [options] Options or callback * @param {Function} [callback] Callback (err, stats)

(fd, options, callback)

Source from the content-addressed store, hash-verified

880 * @param {Function} [callback] Callback (err, stats)
881 */
882 fstat(fd, options, callback) {
883 if (typeof options === 'function') {
884 callback = options;
885 options = undefined;
886 }
887
888 const vfd = getVirtualFd(fd);
889 if (!vfd) {
890 process.nextTick(callback, createEBADF('fstat'));
891 return;
892 }
893
894 vfd.entry.stat(options)
895 .then((stats) => callback(null, stats), (err) => callback(err));
896 }
897
898 /**
899 * Truncates a file asynchronously.

Callers 15

readFileAfterOpenFunction · 0.80
tryStatSyncFunction · 0.80
fstatFunction · 0.80
fstatSyncFunction · 0.80
statMethod · 0.80
afterOpenFunction · 0.80
respondWithFDMethod · 0.80
readFileHandleFunction · 0.80
fstatFunction · 0.80
test-fs-stat.jsFile · 0.80

Calls 5

getVirtualFdFunction · 0.85
createEBADFFunction · 0.85
callbackFunction · 0.50
thenMethod · 0.45
statMethod · 0.45

Tested by

no test coverage detected