smelt.path¶
Tier: Host — Available in every runtime, including headless mode.
Pure path arithmetic: normalize, join, relative, expand, display, etc.
smelt.path.basename¶
Return the final component (file name) of p, or nil if p ends in ...
smelt.path.canonical¶
Resolve p to its canonical absolute form (following symlinks). Returns (path, nil) on success or (nil, err_string) on failure.
smelt.path.commands_dir¶
Return the absolute path to the slash-commands directory under the user config root.
smelt.path.config_dir¶
Return the absolute path to smelt's user config directory.
smelt.path.display¶
Return a user-friendly rendering of p for UI display (e.g. with the home dir abbreviated to ~).
smelt.path.expand¶
Expand a leading ~ in p to the user's home directory.
smelt.path.extension¶
Return the file extension of p (without the leading dot), or nil if there is none.
smelt.path.is_absolute¶
Return true if p is an absolute path on the current platform.
smelt.path.join¶
Join the variadic parts into a single path using the platform separator.
smelt.path.normalize¶
Normalize p by collapsing redundant ., .., and separator components without touching the filesystem.
smelt.path.parent¶
Return the parent directory of p, or nil if p has no parent component.
smelt.path.relative¶
Return the path of target expressed relative to base.