(p: string, cache: {[path: string]: string})
| 590 | } |
| 591 | } |
| 592 | public realpathSync(p: string, cache: {[path: string]: string}): string { |
| 593 | if (this.supportsLinks()) { |
| 594 | // The path could contain symlinks. Split up the path, |
| 595 | // resolve any symlinks, return the resolved string. |
| 596 | const splitPath = p.split(path.sep); |
| 597 | // TODO: Simpler to just pass through file, find sep and such. |
| 598 | for (let i = 0; i < splitPath.length; i++) { |
| 599 | const addPaths = splitPath.slice(0, i + 1); |
| 600 | splitPath[i] = path.join.apply(path, addPaths); |
| 601 | } |
| 602 | return splitPath.join(path.sep); |
| 603 | } else { |
| 604 | // No symlinks. We just need to verify that it exists. |
| 605 | if (this.existsSync(p)) { |
| 606 | return p; |
| 607 | } else { |
| 608 | throw ApiError.ENOENT(p); |
| 609 | } |
| 610 | } |
| 611 | } |
| 612 | public truncate(p: string, len: number, cb: BFSOneArgCallback): void { |
| 613 | this.open(p, FileFlag.getFileFlag('r+'), 0x1a4, (function(er: ApiError, fd?: File) { |
| 614 | if (er) { |
nothing calls this directly
no test coverage detected