Jump to content

FTP: Difference between revisions

491 bytes added ,  3 years ago
m
(Added BaCon version.)
Line 6:
 
=={{header|BaCon}}==
Using libCURL.
<lang bacon>OPTION PARSE FALSE
 
PRAGMA INCLUDE <curl/curl.h>
PRAGMA LDFLAGS -lcurl
 
DECLARE easyhandle TYPE CURL*
 
OPEN "data.txt" FOR WRITING AS download
 
easyhandle = curl_easy_init()
curl_easy_setopt(easyhandle, CURLOPT_URL, "ftp://localhost/pub/data.txt")
curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA, download)
curl_easy_setopt(easyhandle, CURLOPT_USERPWD, "anonymous")
success = curl_easy_perform(easyhandle)
curl_easy_cleanup(easyhandle)
 
CLOSE FILE download</lang>
 
Full native implementation without dependency to external libraries.
<lang bacon>FUNCTION interact$(command$, connection, use_pasv)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.