< Rebol Programming

USAGE:

CLEAN-PATH target 

DESCRIPTION:

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

CLEAN-PATH is a function value.

ARGUMENTS

  • target -- (Type: file url)

SOURCE CODE

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
]
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.