LibCurl to enumerate remote files and foders [Resolved]
Posted: Wed Aug 07, 2024 3:11 pm
Hello at all
I try to use this splendid wrapper than INFRATEC have create for we own
Unfortunately i have not found how ask at CURL to enumerate the elements in the remote path of the server
I have searched all yesterday and just find #CURLOPT_FTPLISTONLY, LIST, and #CURLOPT_VERBOSE who perhaps can have a link with this that i need, but that not works, i just obtain a "OK"
If someone have understand something to the behaviour of this DLL nearly also complicated for me to understant than Scintilla
Have a good day
I try to use this splendid wrapper than INFRATEC have create for we own
Unfortunately i have not found how ask at CURL to enumerate the elements in the remote path of the server
I have searched all yesterday and just find #CURLOPT_FTPLISTONLY, LIST, and #CURLOPT_VERBOSE who perhaps can have a link with this that i need, but that not works, i just obtain a "OK"
If someone have understand something to the behaviour of this DLL nearly also complicated for me to understant than Scintilla
Code: Select all
#Username$ = "XXXX"
#Password$ = "XXXXX"
InitNetwork()
#LibCurl_ExternalDLL = #True
IncludeFile "libcurl.pbi"
#REMOTE_URL = "sftp://MyFtpServer.fr/var/www/html/"
Define curl.i, res.i, *headerlist
curl_global_init(#CURL_GLOBAL_DEFAULT)
curl = curl_easy_init()
If curl
*headerlist = curl_slist_append(*headerlist, "LIST ")
curl_easy_setopt_str(curl, #CURLOPT_URL, #REMOTE_URL)
curl_easy_setopt_str(curl, #CURLOPT_USERNAME, #Username$)
curl_easy_setopt_str(curl, #CURLOPT_PASSWORD, #Password$)
curl_easy_setopt(curl, #CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, #CURLOPT_FTPLISTONLY, 1)
res = curl_easy_perform(curl)
If res = #CURLE_OK
Debug "Ok"
Else
Debug "Error: " + curl_easy_strerror(res)
EndIf
curl_slist_free_all(*headerlist)
curl_easy_cleanup(curl)
EndIf
curl_global_cleanup()