FTP: Difference between revisions

Content added Content deleted
(Added BaCon version.)
Line 6: Line 6:


=={{header|BaCon}}==
=={{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.
Full native implementation without dependency to external libraries.
<lang bacon>FUNCTION interact$(command$, connection, use_pasv)
<lang bacon>FUNCTION interact$(command$, connection, use_pasv)