REBOL Programming/dir?

From Wikibooks, open books for an open world
< REBOL Programming
Jump to: navigation, search

USAGE:[edit]

DIR? target 

DESCRIPTION:[edit]

Returns TRUE if a file or URL is a directory.

DIR? is a function value.

ARGUMENTS[edit]

  • target -- (Type: file url)

(SPECIAL ATTRIBUTES)[edit]

  • catch

SOURCE CODE[edit]

dir?: func [
    "Returns TRUE if a file or URL is a directory." 
    [catch] 
    target [file! url!] 
    /local info
][
    info: throw-on-error [info? target] 
    either none? info [false] [info/type = 'directory]
]