跳轉到內容

Rebol 程式設計/退出

來自華夏公益教科書,為開放世界提供開放書籍
EXISTS? target 

判斷檔案或 URL 是否存在。

EXISTS? 是一個函式值。

  • 目標 -- (型別: 檔案 url)

原始碼

[編輯 | 編輯原始碼]
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]
]
華夏公益教科書