REBOL Programming/clean-path

USAGE:Edit

CLEAN-PATH target 

DESCRIPTION:Edit

Cleans-up '.' and '..' in path; returns the cleaned path.

CLEAN-PATH is a function value.

ARGUMENTSEdit

  • target -- (Type: file url)

SOURCE CODEEdit

clean-path: func [
    {Cleans-up '.' and '..' in path; returns the cleaned path.} 
    target [file! url!]
][
    if url? target [return target] 
    if find [%/ %/. %/..] target [return %/] 
    get-modes target 'full-path
]
Last modified on 27 October 2012, at 22:15