Resolve filesystem path (read-only)
resolve_pathResolves and validates a filesystem path by expanding ~/$HOME/$PREFIX/$TMPDIR, following symlinks, and listing Android-equivalent spellings before handing the path to shell commands or other tools.
Instructions
Resolve and validate one filesystem path in the runtime this server runs in: expands ~/$HOME/$PREFIX/$TMPDIR, follows symlinks, reports the mount backing the path, and lists every Android-equivalent spelling (/sdcard <-> /storage/emulated/0 <-> $HOME/storage/shared). Equivalent inputs: /sdcard/Download/x.txt, $HOME/storage/shared/Download/x.txt, ~/storage/shared/Download/x.txt, and relative docs/report.md (against cwd). Expansion: ~ and $HOME become the server's HOME; $PREFIX is the install prefix (e.g. /data/data/com.termux/files/usr); $TMPDIR is the server's own temp dir, never the client's. Useful when a path has to be handed to a shell command or another tool; not needed for paths already known-good on plain Linux. Sibling boundary: path_adapter reports the environment map itself (env class, HOME/PREFIX/TMPDIR, mount roots) and takes no arguments; resolve_path reports one concrete path. Use path_adapter for the environment, resolve_path for a candidate path. Returns {input, expanded, resolved, env, exists, is_dir, is_file, is_symlink, readable, writable, executable, mount, alternatives, warnings}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to resolve. May be absolute or relative and may contain ~, $HOME, $PREFIX or $TMPDIR. Required and non-empty; an empty string returns an error object instead of raising. |