absolute-path ( path -- path' )
Factor documentation > Factor handbook > Input and output > Pathnames
Prev:normalize-path ( path -- path' )
Next:resolve-symlinks ( path -- path' )


Vocabulary
io.pathnames

Inputs and outputs
patha pathname string
path'a pathname string


Word description
Prepends the current-directory to the pathname and resolves a resource:, ~ or vocab: prefix, if present (see Special pathnames).

Notes
This word is exactly the same as normalize-path, except on Windows NT platforms, where it does not prepend the Unicode path prefix. Most code should call normalize-path instead.

Definition
IN: io.pathnames

GENERIC: absolute-path ( path -- path' )


Methods
USING: accessors io.pathnames ;

M: pathname absolute-path string>> absolute-path ;


USING: io.pathnames kernel namespaces splitting strings ;

M: string absolute-path
"resource:" ?head
[ trim-head-separators resource-path absolute-path ] [
"vocab:" ?head
[ trim-head-separators vocab-path absolute-path ] [
"~" ?head [
trim-head-separators home prepend-path
absolute-path
] [ current-directory get prepend-path ] if
] if
] if ;