(path: string, options?: { followSymlinks?: boolean })
| 582 | } |
| 583 | |
| 584 | async stat(path: string, options?: { followSymlinks?: boolean }): Promise<StatResult> { |
| 585 | const resolved = this._resolvePath(path); |
| 586 | const followSymlinks = options?.followSymlinks ?? true; |
| 587 | // sftpStat / sftpLstat already wrap errors via mapSftpError. |
| 588 | const st = followSymlinks |
| 589 | ? await sftpStat(this._sftp, resolved) |
| 590 | : await sftpLstat(this._sftp, resolved); |
| 591 | |
| 592 | return { |
| 593 | stMode: buildStMode(st), |
| 594 | // SFTP does not provide inode |
| 595 | stIno: 0, |
| 596 | // SFTP does not provide device |
| 597 | stDev: 0, |
| 598 | // ssh2 Stats does not expose nlink |
| 599 | stNlink: 0, |
| 600 | stUid: st.uid, |
| 601 | stGid: st.gid, |
| 602 | stSize: st.size, |
| 603 | stAtime: st.atime, |
| 604 | stMtime: st.mtime, |
| 605 | // SFTP v3 has no ctime, fallback to mtime |
| 606 | stCtime: st.mtime, |
| 607 | }; |
| 608 | } |
| 609 | |
| 610 | async *iterdir(path: string): AsyncGenerator<string> { |
| 611 | const resolved = this._resolvePath(path); |
nothing calls this directly
no test coverage detected