call curl from rebol or red doesn't work

纵饮孤独 提交于 2019-12-30 10:37:35

问题


On dos cmd this works:

curl.exe -L https://dl.uxnr.de/build/curl/curl_winssl_msys2_mingw64_stc/curl-7.53.1/curl-7.53.1.zip > curl.zip

On red or rebol, following suggestion Cannot read a binary file with red from http, I tried code below but it doesn't work why ?

call {curl.exe -L https://dl.uxnr.de/build/curl/curl_winssl_msys2_mingw64_stc/curl-7.53.1/curl-7.53.1.zip > curl.zip}

I also tried call/wait, it doesn't work either.


回答1:


Rebol2:

call/output {curl.exe -L https://www.example.com} data: make string! estimated-big-enough-number

Rebol3 (Ren/C branch):

call/shell/output {curl -L https://www.example.com} data: make binary! 0

;; or

call/output [%/path/to/curl "-L" "https://www.example.com"] data: make binary! 0

;;or a poor mans solution as in e.g.

 call {curl -L -k https://dl.uxnr.de/build/curl/curl_winssl_msys2_mingw64_stc/curl-7.53.1/curl-7.53.1.zip  > this-I-want } data: read %this-I-want

Red:

call/output {curl -L -k https://dl.uxnr.de/build/curl/curl_winssl_msys2_mingw64_stc/curl-7.53.1/curl-7.53.1.zip} data: make binary! 100'000


来源:https://stackoverflow.com/questions/47041154/call-curl-from-rebol-or-red-doesnt-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!