Subject: Re: Error reporting of libssh2_sftp_xxxx functions.

Re: Error reporting of libssh2_sftp_xxxx functions.

From: Alexander Lamaison <>
Date: Mon, 23 Mar 2009 19:23:11 +0000

2009/3/23 Daniel Stenberg <>:
> On Mon, 23 Mar 2009, Jean-Louis CHARTON wrote:
>> I was expecting a more accurate error code like
>> LIBSSH2_FX_FILE_ALREADY_EXISTS or something like that instead.
> There is no such code available! See

As I understand it, LIBSSH2_FX_FILE_ALREADY_EXISTS is only returned by
SFTP v5+ to indicate that the operation could have succeeded if the
call had specified LIBSSH2_SFTP_RENAME_OVERWRITE. As earlier versions
of SFTP (i.e. almost anything in the real world) don't support
overwriting at all, they don't tell you that you could.

I realise this is not very helpful for you, unfortunately. In my own
code, I handle the LIBSSH2_FX_FAILURE error by immediately calling
libssh2_sftp_stat() to see if the directory actually exists and then
react accordingly.



Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial.
libssh2-devel mailing list
Received on 2009-03-23