REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: clean-path

clean-path  file  /only  /dir

Returns new directory path with //, . and .. processed.


file [file! url! string!]


/only - Do not prepend current directory

/dir - Add a trailing / if missing

See also:

split-path   change-dir   dir?   list-dir  


Rebuilds a directory path after decoding parent (..) and current (.) path indicators.

probe clean-path %com/www/../../../graphics/image.jpg
messy-path: %/rebol/scripts/neat-stuff/../../experiments/./tests
neat-path: clean-path messy-path
probe neat-path

URLs are returned unmodified (because the true paths may not be known).

  TOC < Back Next > - WIP Wiki Feedback Admin