(path: string)
| 458 | } |
| 459 | |
| 460 | async readlink(path: string): Promise<string> { |
| 461 | await this.ensureInit(); |
| 462 | const normalized = normalizePath(path); |
| 463 | const T = this.tableName; |
| 464 | const rows = await this.sql.query<{ |
| 465 | type: string; |
| 466 | target: string | null; |
| 467 | }>(`SELECT type, target FROM ${T} WHERE path = ?`, normalized); |
| 468 | const r = rows[0]; |
| 469 | if (!r) throw new Error(`ENOENT: no such file or directory: ${path}`); |
| 470 | if (r.type !== "symlink" || !r.target) |
| 471 | throw new Error(`EINVAL: not a symlink: ${path}`); |
| 472 | return r.target; |
| 473 | } |
| 474 | |
| 475 | async lstat(path: string): Promise<FileStat | null> { |
| 476 | await this.ensureInit(); |
no test coverage detected