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

Function fstatSync

lib/fs.js:2021–2032  ·  view source on GitHub ↗

* Synchronously retrieves the `fs.Stats` for * the file descriptor. * @param {number} fd * @param {{ bigint?: boolean; }} [options] * @returns {Stats | undefined}

(fd, options = { __proto__: null, bigint: false })

Source from the content-addressed store, hash-verified

2019 * @returns {Stats | undefined}
2020 */
2021function fstatSync(fd, options = { __proto__: null, bigint: false }) {
2022 const h = vfsState.handlers;
2023 if (h !== null) {
2024 const result = h.fstatSync(fd);
2025 if (result !== undefined) return result;
2026 }
2027 const stats = binding.fstat(fd, options.bigint, undefined, false);
2028 if (stats === undefined) {
2029 return;
2030 }
2031 return getStatsFromBinding(stats);
2032}
2033
2034/**
2035 * Synchronously retrieves the `fs.Stats` for

Callers

nothing calls this directly

Calls 3

getStatsFromBindingFunction · 0.85
fstatSyncMethod · 0.80
fstatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…