Rebol 编程/clean-path
外观
< Rebol 编程
CLEAN-PATH target
清理路径中的“.”和“..”;返回清理后的路径。
CLEAN-PATH 是一个函数值。
- 目标 -- (类型:文件 URL)
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
]