user2142250
user2142250

Reputation: 349

PuTTY PSFTP return codes

I've been unable to find a list of PuTTY (psftp.exe) exit values or return codes.

The only thing I found is this: https://the.earth.li/~sgtatham/putty/0.67/htmldoc/Chapter10.html#errors, but I need the return codes.

Your help is appreciated.

Upvotes: 1

Views: 6625

Answers (2)

Martin Prikryl
Martin Prikryl

Reputation: 202292

PSFTP has these exit codes:

  • 0 - success
  • 1 - fatal error
  • 2 - command error (when -be is not used)

Upvotes: 2

Random832
Random832

Reputation: 39020

For most programs, there isn't generally a lot of informational content in exit codes. If you're trying to automate detailed error handling (why is your question tagged with java and c#?) you may need to parse error messages.

Looking at the source code, it appears that it returns 1 if there is a connection error or if it is unable to open a batch file, 2 if a command fails in batch mode, and 0 otherwise.

Upvotes: 2

Related Questions