But do exit when you have completed with libssh2, else let is be in open mode. Otherwise commands will not work. On Sep 14, 2010, at 2:13 PM, Uli Zappe wrote:
> Am 14.09.2010 um 10:22 schrieb double: > >> This is also what I thought about. The problem: >> >> 1. libssh2_channel_open_session() >> 2. libssh2_channel_exec( "cd /workingdir" ); >> 3. libssh2_channel_close() >> 4. libssh2_channel_wait_closed() >> 5. libssh2_channel_get_exit_status() >> >> Now I can see, if "cd /workingdir" returned "0", but the channel is closed. > > Why don't you do the error checking within the script you're going to execute? > > i.e. libssh2_channel_exec( "if cd /workingdir; then continue; else echo > failure; exit; fi" ); > > > Bye > Uli > ________________________________________________________ > > Uli Zappe, Solmsstraße 5, D-65189 Wiesbaden, Germany > http://www.ritual.org > Fon: +49-700-ULIZAPPE > Fax: +49-700-ZAPPEFAX > ________________________________________________________ > > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
