| 176 | } |
| 177 | |
| 178 | statSync(path: string, _options?: { bigint?: boolean }): VirtualStatsLike { |
| 179 | // statImpl resolves the path once (following symlinks) and returns |
| 180 | // the inode, so nlink comes from the same walk. A pending-create |
| 181 | // file reports inode 0, which yields nlink 1. |
| 182 | const s = statImpl(this.db, path); |
| 183 | return wrapStats({ |
| 184 | mode: s.mode, |
| 185 | size: s.size, |
| 186 | mtimeMs: s.mtime, |
| 187 | ino: s.inode, |
| 188 | isFile: s.isFile, |
| 189 | isDirectory: s.isDirectory, |
| 190 | isSymbolicLink: false, |
| 191 | nlink: linkCount(this.db, s.inode), |
| 192 | }); |
| 193 | } |
| 194 | |
| 195 | lstat(path: string, options?: { bigint?: boolean }): Promise<VirtualStatsLike> { |
| 196 | return Promise.resolve(this.lstatSync(path, options)); |