| 1782 | } |
| 1783 | |
| 1784 | async function lstat(path, options = { __proto__: null, bigint: false }) { |
| 1785 | const h = vfsState.handlers; |
| 1786 | if (h !== null) { |
| 1787 | const promise = h.lstat(path, options); |
| 1788 | if (promise !== undefined) return await promise; |
| 1789 | } |
| 1790 | path = getValidatedPath(path); |
| 1791 | if (permission.isEnabled() && !permission.has('fs.read', path)) { |
| 1792 | const resource = pathModule.toNamespacedPath(BufferIsBuffer(path) ? BufferToString(path) : path); |
| 1793 | throw new ERR_ACCESS_DENIED('Access to this API has been restricted', 'FileSystemRead', resource); |
| 1794 | } |
| 1795 | const result = await PromisePrototypeThen( |
| 1796 | binding.lstat(path, options.bigint, kUsePromises), |
| 1797 | undefined, |
| 1798 | handleErrorFromBinding, |
| 1799 | ); |
| 1800 | return getStatsFromBinding(result); |
| 1801 | } |
| 1802 | |
| 1803 | async function stat(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true }) { |
| 1804 | const h = vfsState.handlers; |