| vishy 2006-06-26, 11:22 pm |
| I am using expect for sftp.
The problem that I am facing is that , for some cases expect is not able to recognize the sftp response strings immediately. It does recognize but after flowing the sftp command for sometime..
Is there any buffer that should be cleared after we do some "write"?
Here say if we run the command “ get a”.txt ( where a.txt is the file name), and if the file is not present, sftp display the following error message:
Couldn"t stat remote file: No such file or directory
sftp>
But the problem is exp_expectl() is not able to recognize it immediately; Due to which the command keeps running in loop.. and after sometime it expectl() recognizes the string and goes to the correct case. I need some help in how I can make expectl to recongnize at the first go.
Please find the C code in the attachement |