Rebol 程式設計/clean-path
外觀
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
]