Subject: Re: Error reporting of libssh2_sftp_xxxx functions.

Re: Error reporting of libssh2_sftp_xxxx functions.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 23 Mar 2009 19:55:40 +0100 (CET)

On Mon, 23 Mar 2009, Jean-Louis CHARTON wrote:

> My problem is that if I try to create a directory thanks to
> libssh2_sftp_mkdir(), and if the directory already exists on the remote SSH
> server, libssh2_sftp_mkdir() fails; which is what I'm expecting so far; BUT
> the error returned by libssh2_sftp_last_error() is either 4 (i.e.
> LIBSSH2_FX_FAILURE) if the SSH server is an openssh running on a Linux box
> or 5 (i.e. LIBSSH2_FX_BAD_MESSAGE) if the server is a freeSSHD server
> running on a Windows 2003 server box. In both cases, the error code returned
> by libssh2_session_last_error() is -31 (i.e. LIBSSH2_ERROR_SFTP_PROTOCOL).

libssh2_sftp_last_error() simply returns that error the server responded with.
libssh2 is "only" talking SFTP protocol version 3 which might be a reason or
perhaps the servers just don't give a more detailed answer...

> 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
http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-02.txt

-- 
  / daniel.haxx.se
------------------------------------------------------------------------------
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. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2009-03-23