Skip to main content

builtin_path_expand

Function builtin_path_expand 

Source
fn builtin_path_expand(
    args: &[RValue],
    _named: &[(String, RValue)],
    context: &BuiltinContext<'_>,
) -> Result<RValue, RError>
Expand description

Expand a tilde (~) prefix in a file path to the user’s home directory.

Uses dirs::home_dir() (when the dirs-support feature is enabled) for robust, cross-platform home directory detection, falling back to $HOME / %USERPROFILE% environment variables.

@param path character scalar: path possibly starting with ~ @return character scalar: the expanded path