cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE : Remote file information using sftp

From: Mele Giovanni <giovanni.mele_at_nagra.com>
Date: Wed, 5 Jan 2011 22:50:17 +0100

Hello,
 
> SFTP has basically nothing else in comon with FTP besides the fact that they
> both run over TCP. Lots of libcurl code paths and logic are different between
> those protocols.

I've seen it... Our application are currently using libcurl to do some ftp transfer. For security reasons, we have to use sftp instead of ftp. I'm working on this part.
 
> Your libssh2 version is also highly relevant.

We are using libssh2 1.2.7 and openssl 0.9.8a
 
> I looked at the code right now and I can't see that we ever introduced support
> for CURLOPT_FILETIME with SFTP. A bug!

> It should be quite doable to support for SFTP, and I believe even for SCP.
> You up to make a patch to make it happen?

I do not have time now to make this kind of patch (CURLOPT_FILETIME) as our customer wants a solution very quickly (end of this month, we have to deliver a first release). Do you think it would be possible to also retrieve the remote file size with sftp? Currently, I'm doing a list of the remote folder containing the file and then I parse the output to get the last mod date and file size :-/. This solution is temporary and I'd like a find a cleaner way to have this information.
 
 
Regards
 
Giovanni

________________________________

De: curl-library-bounces_at_cool.haxx.se de la part de Daniel Stenberg
Date: mar. 04.01.2011 23:49
À: libcurl development
Objet : Re: Remote file information using sftp

On Tue, 4 Jan 2011, Mele Giovanni wrote:

> I'm trying to get a remote file information, mainly size and modification
> date) using the curl library. All is working fine when connection on a
> normal ftp server, but as soon as I try to use an sftp server, I get no
> information about the remote file.

SFTP has basically nothing else in comon with FTP besides the fact that they
both run over TCP. Lots of libcurl code paths and logic are different between
those protocols.

> I'm using libcurl 7.21.3 compiled to enable sftp.

Your libssh2 version is also highly relevant.

> curl_easy_setopt(_guts->_curl, CURLOPT_FILETIME, 1);

I looked at the code right now and I can't see that we ever introduced support
for CURLOPT_FILETIME with SFTP. A bug!

It should be quite doable to support for SFTP, and I believe even for SCP.

You up to make a patch to make it happen?

--
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-01-05