REBOL Programming/exists?

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

USAGE:[edit]

EXISTS? target 

DESCRIPTION:[edit]

Determines if a file or URL exists.

EXISTS? is a function value.

ARGUMENTS[edit]

  • target -- (Type: file url)

SOURCE CODE[edit]

exists?: func [
    "Determines if a file or URL exists." 
    target [file! url!] 
    /local ret
][
    either error? try [
        target: make port! target 
        query target
    ] [false] [found? target/status]
]