REBOL Programming/size?

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

USAGE:[edit]

SIZE? target 

DESCRIPTION:[edit]

Returns the size of a file or URL's contents.

SIZE? is a function value.

ARGUMENTS[edit]

  • target -- (Type: file url)

(SPECIAL ATTRIBUTES)[edit]

  • catch

SOURCE CODE[edit]

size?: func [
    "Returns the size of a file or URL's contents." 
    [catch] 
    target [file! url!] 
    /local info
][
    info: throw-on-error [info? target] 
    either none? info [none] [info/size]
]