metaeducation / rebol-issues

6 stars 1 forks source link

SYS/READ-DECODE can read extension module from url!, but LOAD-EXTENSION will fail #1709

Open rebolbot opened 14 years ago

rebolbot commented 14 years ago

Submitted by: meijeru

For an extension module, SYS/READ-DECODE calls LOAD-EXTENSION, but that function does not accept a url! source

sys/read-decode: make function! [[
    {Reads code/data from source or DLL, decodes it, returns result
     (binary, block, image,...).}
    source [file! url!] "Source or block of sources?"
    type [word! none!] "File type, or NONE for binary raw data"
    /local data
][
    either type = 'extension [
        data: load-extension source
    ] [
        data: read source
        if find system/options/file-types type
               [data: decode type :data]
    ]
    data
]]
load-extension: make native! [[
    "Low level extension module loader (for DLLs)."
    name [file! binary!] "DLL file or UTF-8 source"
    /dispatch {Specify native command dispatch (from hosted extensions)}
    function [handle!] "Command dispatcher (native)"
]]

CC - Data [ Version: alpha 109 Type: Bug Platform: All Category: Unspecified Reproduce: Always Fixed-in:none ]

rebolbot commented 14 years ago

Submitted by: Carl

In order to make that work, we'd need to download the URL to a cache file, and load the DLL from that file.

Obviously, there are major security issues with doing that. In addition, where would the file be cached?

So, it's possible, but requires definition. So, let's defer it to 3.1.

rebolbot commented 14 years ago

Submitted by: meijeru

I understand that in the meantime you are happy with such cases ending in a type incompatibility error.

rebolbot commented 14 years ago

Submitted by: Carl

Or we could give an explicit error message about it.