Resolve

NAME

File::Path::Resolve

METHODS

absolute($path)

Method absolute runs IO.resolve on paths to produce absolute paths after expanding leading ~/ to $*HOME.

Rakudo considers paths starting with a ~/ to be relative paths:

'~'.IO.is-relative.so       # True
    '~/'.IO.is-relative.so      # True
    '~/hello'.IO.is-relative.so # True

This method expands the leading ~/ to $*HOME. Thus, it does not consider paths beginning with ~/ to be relative paths.

relative($path, $base)

Method relative resolves a path ($path) relative to the base directory of a file ($base).

This method is intended for config files which allow users to specify relative paths. When relative paths are given in a config file, these relative paths should be resolved relative to the config file's base directory for DWIM.

Like method absolute, method relative expands leading ~/s to $*HOME. Thus, it does not consider paths beginning with ~/ to be relative paths.

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.