After further testing, it appears that it worked once, and then has stopped working.
It looks like I'm not able to overwrite the file, despite setting the flags: LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC The first time, the writing works, and if I delete the file from the server using a separate session, then the writing works again. Are there other flags or things to check so that a file can be overwritten, some unix permission I'm not setting when the file is initially created? On Mon, May 2, 2011 at 11:42 AM, Peter Stuge <pe...@stuge.se> wrote: > Mark Roden wrote: >> Essentially, the server returns an error code, '2'. > > The server sometimes also returns a text message. > > If this is indeed the error code from the server then it should be > well defined in the SFTP spec. Likewise the error message may provide > hints on what is going wrong. > > Both the error code and the error message are retrievable using > libssh2 API after libssh2_sftp_open (or another function call) fails. > > >> I don't know if it's a libssh2 error or not. > > Is the home directory for your user writable by the user? Maybe there > is just a path missing somewhere to specify the upload directory. > > > //Peter > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel