跳轉到內容

Rebol 程式設計/do-thru

來自華夏公益教科書,開放的書籍,為開放的世界
DO-THRU url /args arg /update /check info /boot 

從磁碟快取執行網路檔案。

DO-THRU 是一個函式值。

  • url -- (型別:url 檔案)
  • /args
    • arg -- (型別:任何)
  • /update -- 強制從源站點更新
  • /check -- 僅當版本、校驗和/安全或日期/大小不匹配時更新。
    • info -- (型別:任何)
  • /boot -- 作為引導指令碼執行(設定 system/options/path)

原始碼

[編輯 | 編輯原始碼]
do-thru: func [
    "Do a net file from the disk cache." 
    url [url! file!] 
    /args arg 
    /update "Force update from source site" 
    /check {Update only if version, checksum/secure, or date/size do not match.} info 
    /boot "Run as boot script (sets system/options/path)" 
    /local data
][
    if not data: either update [
        read-thru/update/expand url
    ] [
        read-thru/check/expand url info
    ] [
        alert reform ["Cannot run" url] 
        return none
    ] 
    url: path-thru url 
    if boot [system/options/path: first split-path url] 
    do/args url arg
]
華夏公益教科書