Rebol Programming/exists?

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

USAGE:[edit | edit source]

EXISTS? target 

DESCRIPTION:[edit | edit source]

Determines if a file or URL exists.

EXISTS? is a function value.

ARGUMENTS[edit | edit source]

  • target -- (Type: file url)

SOURCE CODE[edit | edit source]

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]
]