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.

Arguments:

file [file! url! string!]

Refinements:

/only - Do not prepend current directory

/dir - Add a trailing / if missing

See also:

split-path   change-dir   dir?   list-dir  

Description

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

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

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


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin