For Programmers: Free Programming Magazines  


Home > Archive > Tcl > June 2006 > Using expect for sftp operation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Using expect for sftp operation
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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com