cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Directory exists?curl with sftp

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 3 Mar 2014 19:00:05 +0100 (CET)

On Mon, 3 Mar 2014, san d wrote:

> I am trying to find out whether a particular directory exists on my SFTP
> destination. However, for a non-existent directory the following snippet of
> code returning CURLE_OK.
>
> Could someone help me out in achieving my requirement?
>
> curl_easy_setopt(curl, CURLOPT_DIRLISTONLY, 1L);
> curl_easy_setopt(curl, CURLOPT_URL, sftptargetURL);
> curl_easy_setopt(curl, CURLOPT_NOBODY, 1);
>
> CURLcode errorCode = curl_easy_perform(curl);

That sounds like a bug. Can you debug it and see what libssh2_sftp_open_ex()
returns in the SSH_SFTP_READDIR_INIT state in lib/ssh.c ?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-03-03