* Retrieves the `fs.Stats` for the symbolic link * referred to by the `path`. * @param {string | Buffer | URL} path * @param {{ bigint?: boolean; }} [options] * @param {( * err?: Error, * stats?: Stats * ) => any} callback * @returns {void}
(path, options = { __proto__: null, bigint: false }, callback)
| 1929 | * @returns {void} |
| 1930 | */ |
| 1931 | function lstat(path, options = { __proto__: null, bigint: false }, callback) { |
| 1932 | if (typeof options === 'function') { |
| 1933 | callback = options; |
| 1934 | options = kEmptyObject; |
| 1935 | } |
| 1936 | |
| 1937 | const h = vfsState.handlers; |
| 1938 | if (h !== null && vfsResult(h.lstat(path, options), callback)) return; |
| 1939 | |
| 1940 | callback = makeStatsCallback(callback); |
| 1941 | path = getValidatedPath(path); |
| 1942 | if (permission.isEnabled() && !permission.has('fs.read', path)) { |
| 1943 | const resource = BufferIsBuffer(path) ? BufferToString(path) : path; |
| 1944 | callback(new ERR_ACCESS_DENIED('Access to this API has been restricted', 'FileSystemRead', resource)); |
| 1945 | return; |
| 1946 | } |
| 1947 | |
| 1948 | const req = new FSReqCallback(options.bigint); |
| 1949 | req.oncomplete = callback; |
| 1950 | binding.lstat(path, options.bigint, req); |
| 1951 | } |
| 1952 | |
| 1953 | /** |
| 1954 | * Asynchronously gets the stats of a file. |