(sessionId: string, req: FsStatRequest)
| 267 | } |
| 268 | |
| 269 | async stat(sessionId: string, req: FsStatRequest): Promise<FsEntry> { |
| 270 | const session = await this.sessions.get(sessionId); |
| 271 | const cwd = session.metadata.cwd; |
| 272 | const safe = await resolveSafePath(cwd, req.path); |
| 273 | let st: import('node:fs').Stats; |
| 274 | try { |
| 275 | st = await fs.stat(safe.absolute); |
| 276 | } catch (err) { |
| 277 | throw mapStatError(err, req.path); |
| 278 | } |
| 279 | const name = |
| 280 | safe.relative === '.' ? path.basename(cwd) : path.basename(safe.absolute); |
| 281 | |
| 282 | return buildFsEntryFromStat(safe.relative, name, safe.absolute, st, true); |
| 283 | } |
| 284 | |
| 285 | async statMany( |
| 286 | sessionId: string, |
nothing calls this directly
no test coverage detected