(p: string, cache: {[path: string]: string}, cb: BFSCallback<string>)
| 569 | } |
| 570 | } |
| 571 | public realpath(p: string, cache: {[path: string]: string}, cb: BFSCallback<string>): void { |
| 572 | if (this.supportsLinks()) { |
| 573 | // The path could contain symlinks. Split up the path, |
| 574 | // resolve any symlinks, return the resolved string. |
| 575 | const splitPath = p.split(path.sep); |
| 576 | // TODO: Simpler to just pass through file, find sep and such. |
| 577 | for (let i = 0; i < splitPath.length; i++) { |
| 578 | const addPaths = splitPath.slice(0, i + 1); |
| 579 | splitPath[i] = path.join.apply(null, addPaths); |
| 580 | } |
| 581 | } else { |
| 582 | // No symlinks. We just need to verify that it exists. |
| 583 | this.exists(p, function(doesExist) { |
| 584 | if (doesExist) { |
| 585 | cb(null, p); |
| 586 | } else { |
| 587 | cb(ApiError.ENOENT(p)); |
| 588 | } |
| 589 | }); |
| 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, |
nothing calls this directly
no test coverage detected