FTP: Difference between revisions
Content added Content deleted
m (Specify Rust crate usage) |
|||
Line 595: | Line 595: | ||
5MB.zip |
5MB.zip |
||
upload</pre> |
upload</pre> |
||
=={{header|Phix}}== |
|||
<lang Phix>include libcurl.e |
|||
constant url = "ftp://speedtest.tele2.net/" |
|||
curl_global_init() |
|||
atom curl = curl_easy_init(), |
|||
pErrorBuffer = allocate(CURL_ERROR_SIZE) |
|||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, pErrorBuffer) |
|||
curl_easy_setopt(curl, CURLOPT_URL, url) |
|||
object res = curl_easy_perform_ex(curl) |
|||
if integer(res) then |
|||
?{res,peek_string(pErrorBuffer)} |
|||
else |
|||
puts(1,res) |
|||
end if |
|||
string filename = "1KB.zip" |
|||
{} = delete_file(filename) |
|||
res = curl_easy_get_file(url&filename, "", filename) |
|||
if res=CURLE_OK then |
|||
printf(1,"successfully downloaded %s (size %s)\n",{filename,get_file_size(filename,true)}) |
|||
else |
|||
?{"error",res} |
|||
end if</lang> |
|||
{{out}} |
|||
<pre> |
|||
-rw-r--r-- 1 0 0 1073741824000 Feb 19 2016 1000GB.zip |
|||
-rw-r--r-- 1 0 0 107374182400 Feb 19 2016 100GB.zip |
|||
-rw-r--r-- 1 0 0 102400 Feb 19 2016 100KB.zip |
|||
-rw-r--r-- 1 0 0 104857600 Feb 19 2016 100MB.zip |
|||
-rw-r--r-- 1 0 0 10737418240 Feb 19 2016 10GB.zip |
|||
-rw-r--r-- 1 0 0 10485760 Feb 19 2016 10MB.zip |
|||
-rw-r--r-- 1 0 0 1073741824 Feb 19 2016 1GB.zip |
|||
-rw-r--r-- 1 0 0 1024 Feb 19 2016 1KB.zip |
|||
-rw-r--r-- 1 0 0 1048576 Feb 19 2016 1MB.zip |
|||
-rw-r--r-- 1 0 0 209715200 Feb 19 2016 200MB.zip |
|||
-rw-r--r-- 1 0 0 20971520 Feb 19 2016 20MB.zip |
|||
-rw-r--r-- 1 0 0 2097152 Feb 19 2016 2MB.zip |
|||
-rw-r--r-- 1 0 0 3145728 Feb 19 2016 3MB.zip |
|||
-rw-r--r-- 1 0 0 524288000 Feb 19 2016 500MB.zip |
|||
-rw-r--r-- 1 0 0 52428800 Feb 19 2016 50MB.zip |
|||
-rw-r--r-- 1 0 0 524288 Feb 19 2016 512KB.zip |
|||
-rw-r--r-- 1 0 0 5242880 Feb 19 2016 5MB.zip |
|||
drwxr-xr-x 2 105 108 561152 Jul 18 13:11 upload |
|||
successfully downloaded 1KB.zip (size 1KB) |
|||
</pre> |
|||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |