REBOL Programming/info?

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

USAGE:[edit]

INFO? target 

DESCRIPTION:[edit]

Returns information about a file or url.

INFO? is a function value.

ARGUMENTS:[edit]

  • target -- (Type: file url)

(SPECIAL ATTRIBUTES)[edit]

  • catch

SOURCE CODE[edit]

info?: func [
    "Returns information about a file or url." 
    [catch] 
    target [file! url!]
][
    throw-on-error [
        target: make port! target 
        query target
    ] 
    either none? target/status [
        none
    ] [
        make object! [
            size: target/size date: target/date type: target/status
        ]
    ]
]