curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: How to identify that extensions are not supported on SFTP server? [libcurl]

From: Dan Fandrich via curl-library <>
Date: Wed, 22 Nov 2023 13:39:04 -0800

On Wed, Nov 22, 2023 at 07:26:15PM +0000, Nimit Dhulekar via curl-library wrote:
> We have been using statvfs as a CURLOPT_QUOTE command via libcurl to identify
> whether the entry on the SFTP server is a file or folder. Is there any way to
> know in advance (preferably through libcurl) that a certain command is not
> supported on an SFTP server?

libssh2 just throws away the list of SFTP protocol extensions sent by the
server that would allow it (or clients) to know whether or not statvfs would
work or not. I don't know how libssh deals with this info, but determining a
priori if statvfs will work using libssh2 would require changing libssh2 to
return this info to the client somehow, then writing a libssh2 program to query
that info before running curl, or somehow shoehorning that function into
libcurl (via curl_easy_getinfo() perhaps).

Received on 2023-11-22