Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Rebol Programming/load-thru

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

USAGE: LOAD-THRU url /update /binary /to local-file /all /expand /check info DESCRIPTION: Load a net file from the disk cache. LOAD-THRU is a function value. ARGUMENTS: url -- (Type: url file) REFINEMENTS: /update -- Force update from source site /binary -- Force binary mode, otherwise expects REBOL data or code. /to -- Specify local file target. local-file -- (Type: file none) /all -- Return block with REBOL script including unevaluated header (safe mode). /expand -- Auto-decompress after transfer. /check -- Update only if version, checksum/secure, or date/size do not match. info -- (Type: any) SOURCE CODE load-thru: func [ "Load a net file from the disk cache." url [url! file!] /update "Force update from source site" /binary {Force binary mode, otherwise expects REBOL data or code.} /to "Specify local file target." local-file [file! none!] /all {Return block with REBOL script including unevaluated header (safe mode).} /expand "Auto-decompress after transfer." /check {Update only if version, checksum/secure, or date/size do not match.} info /local data ][ if not data: either update [ read-thru/update/to/expand url local-file ] [ read-thru/to/expand/check url local-file info ] [ return none ] if binary [return load data] if error? try [ data: either all [load/all to-string data] [load to-string data] ] [return none] data ]