REBOL Document

Split-path - Function Summary


Summary:

Splits a file or URL path. Returns a block containing path and target.

Usage:

split-path target

Arguments:

target - The target argument. (must be: file url)

Description:

Returns a block consisting of two elements, the path and the file. Can be used on URLs and files alike.


    probe split-path %tests/math/add.r
    [%tests/math/ %add.r]


    set [path file] split-path http://www.rebol.com/graphics/logo.gif
    print path
    http://www.rebol.com/graphics/


    print file
    logo.gif

Related:

clean-path - Cleans-up '.' and '..' in path; returns the cleaned path.
suffix? - Return the suffix (ext) of a filename or url, else NONE.


<Back | Index | Next>

Copyright 2004 REBOL Technologies