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

Function getStatsFromBinding

lib/internal/fs/utils.js:682–705  ·  view source on GitHub ↗

* @param {Float64Array | BigInt64Array} stats * @param {number} offset * @returns {BigIntStats | Stats}

(stats, offset = 0)

Source from the content-addressed store, hash-verified

680 * @returns {BigIntStats | Stats}
681 */
682function getStatsFromBinding(stats, offset = 0) {
683 if (isBigInt64Array(stats)) {
684 return new BigIntStats(
685 stats[0 + offset], stats[1 + offset], stats[2 + offset],
686 stats[3 + offset], stats[4 + offset], stats[5 + offset],
687 stats[6 + offset], stats[7 + offset], stats[8 + offset],
688 stats[9 + offset],
689 nsFromTimeSpecBigInt(stats[10 + offset], stats[11 + offset]),
690 nsFromTimeSpecBigInt(stats[12 + offset], stats[13 + offset]),
691 nsFromTimeSpecBigInt(stats[14 + offset], stats[15 + offset]),
692 nsFromTimeSpecBigInt(stats[16 + offset], stats[17 + offset]),
693 );
694 }
695 return new Stats(
696 stats[0 + offset], stats[1 + offset], stats[2 + offset],
697 stats[3 + offset], stats[4 + offset], stats[5 + offset],
698 stats[6 + offset], stats[7 + offset], stats[8 + offset],
699 stats[9 + offset],
700 stats[10 + offset], stats[11 + offset], // atime
701 stats[12 + offset], stats[13 + offset], // mtime
702 stats[14 + offset], stats[15 + offset], // ctime
703 stats[16 + offset], stats[17 + offset], // birthtime
704 );
705}
706
707class StatFs {
708 constructor(type, bsize, frsize, blocks, bfree, bavail, files, ffree) {

Callers 13

makeStatsCallbackFunction · 0.85
fstatSyncFunction · 0.85
lstatSyncFunction · 0.85
statSyncFunction · 0.85
fillBigIntStatsArrayFunction · 0.85
createFileStatsFunction · 0.85
createDirectoryStatsFunction · 0.85
createSymlinkStatsFunction · 0.85
createZeroStatsFunction · 0.85
fstatFunction · 0.85
lstatFunction · 0.85
statFunction · 0.85

Calls 2

isBigInt64ArrayFunction · 0.85
nsFromTimeSpecBigIntFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…