cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl MLST

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sun, 7 Feb 2016 12:53:26 +0100

On Sun, Feb 07, 2016 at 01:15:54PM +0300, Алексей Тумакаев wrote:
> Hello, i'm trying to get filelists from 2 ftp servers using MLST request, but
> it doesn't work
>
> Version: libcurl/7.23.1 OpenSSL/0.9.8r zlib/1.2.5 libssh2/1.3.0
> Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp
> sftp smtp smtps telnet tftp
>
> 1)
>
> - FTP (MLST is not commented)
[...]
> > MLST
> < 250-Start of list for /
> < /
> < 250 End of list
> * RETR response: 250
> * Remembering we are in dir ""
> * Connection #0 to host spr1an.myarena.ru left intact
> > QUIT
> < 221 Goodbye.
> * Closing connection #0
>
> Why MLST is empty?

It's not empty—it's returning a single entry, which is what it's documented to
do. Maybe you're looking for the MLSD command?

> 1)
> - SFTP (MLST is not commented)
>
>
> curl_easy_setopt(curl, CURLOPT_URL, "sftp://xxxxxxxx:5000/");
> curl_easy_setopt(curl, CURLOPT_USERPWD, "xxx:xxx");
> curl_easy_setopt_function(curl, CURLOPT_WRITEFUNCTION, GetFileList);
> curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
> curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST , "MLST");
> curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
> curl_easy_perform_thread(curl, onCompleteFilelist, 1);
>
> result:
>
>
> * About to connect() to xxx.xxx.xxx.xxx port 5000 (#0)
> * Trying xxx.xxx.xxx.xxx...
> * connected
> * SSH authentication methods available:
> publickey,gssapi-keyex,gssapi-with-mic,password
> * Using ssh public key file id_dsa.pub
> * Using ssh private key file id_dsa
> * SSH public key authentication failed: Unable to open public key file
> * Initialized password authentication
> * Authentication complete
> DATA:
> drwxr-xr-x 11 root root 0 Mar 27 2014 sys
>
> * Connection #0 to host xxx.xxx.xxx.xxx left intact
> * Closing connection #0
>
> In this case curl doesn't try to execute MLST command.

That's because MLST isn't an sftp command; sftp != ftps. Custom requests aren't
supported for sftp.

>>> Dan

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-02-07