Return the absolute path of the given path as calculated by the caller's host using OS-specific rules.
(ctx context.Context, path string)
| 59 | |
| 60 | // Return the absolute path of the given path as calculated by the caller's host using OS-specific rules. |
| 61 | func (c *Client) AbsPath(ctx context.Context, path string) (string, error) { |
| 62 | msg := fsutiltypes.Stat{} |
| 63 | err := c.diffcopy(ctx, engine.LocalImportOpts{ |
| 64 | Path: path, |
| 65 | GetAbsPathOnly: true, |
| 66 | }, &msg) |
| 67 | if err != nil { |
| 68 | return "", fmt.Errorf("failed to stat path: %w", err) |
| 69 | } |
| 70 | return msg.Path, nil |
| 71 | } |
| 72 | |
| 73 | func (c *Client) StatCallerHostPath(ctx context.Context, path string, returnAbsPath bool) (*fsutiltypes.Stat, error) { |
| 74 | msg := fsutiltypes.Stat{} |
no test coverage detected