[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting mkdir command result


2011/1/12 Nikhil Agrawal <mrnikhilagrawal@xxxxxxxxx>:
> Hi,
>
> I am using libssh to run mkdir on remote machine. In case mkdir fails, I
> want to receive/get error in my client so i can take measures. I am getting
> OK as return code in all cases and don’t get to know if mkdir successfully
> ran or not. Please Suggest.
>
> Thanks!
>

hi Nikhil

how about take the return code of the command , and judge if it equals to 0

mkdir: cannot create directory `xxx': File exists
$echo $?
1

Juster.Wang

References:
Getting mkdir command resultNikhil Agrawal <mrnikhilagrawal@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org