Subject: Re: sftp error - LIBSSH2_ERROR_SFTP_PROTOCOL


From: Daniel Stenberg <>
Date: Thu, 6 May 2010 13:36:45 +0200 (CEST)

On Wed, 5 May 2010, Phillip Wu wrote:

> 1) Is it true to say that LIBSSH2_ERROR_SFTP_PROTOCOL is not really an error
> as such and I should always call libssh2_sftp_last_error when ever I

It really depends on what you're trying to find out. The
LIBSSH2_ERROR_SFTP_PROTOCOL error means that libssh2 stopped because there was
an error on SFTP level.

libssh2_sftp_last_error() is then your friend to extract the latest error that
libssh2 received over SFTP.

> 2) Where can I get a table of the codes returned by libssh2_sftp_last_error 
> and their meanings?

The SFTP errors are straight from the SFTP protocol and are present in
libssh2_sftp.h with the LIBSSH2_FX_ prefix. See line 171 and onwards.


Received on 2010-05-06