Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using http://phpseclib.sourceforge.net/ to make an SSH connection to my server, then execute an SCP command to transfers to a remote server. The library's exec() method returns a string (looks like the standard output of the SCP command) instead of the return value of the command (e.g. 0 to indicate success).

I'm reluctant to do some sort of string comparison to determine if the SCP transfer was successful or not (right now, I get "stdin: is not a tty"). Is there an SSH command I can use to determine if a file exist on another server? Or any suggestions on how else I can verify if the file transferred?

share|improve this question
up vote 0 down vote accepted

enablyPTY() should fix the stdin: is not a tty. You can also suppress stderr in phpseclib with enableQuietMode(). getExitStatus() will return the exit status.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .