Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
Expect error

Posted by CS (CS), 27 June 2005
I am having a problem in a expect scripts. The script essentially spawns a ftp process and uses it to transfer files.  
The env details are:
OS: windows 2003 enterprise edition, version 5.2, sp1, v1
ActiveTcl : 8.4.6.1
Expect4Win: 1.0

I have been able to run the scripts from another Server which has same configuration.

The output shows :
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>expect: does "" (spawn_id exp4) match glob pattern "ftp>"? no
> expect: read eof
> expect: set expect_out(spawn_id) "exp4"
> expect: set expect_out(buffer) ""


Thanks for the help






Posted by admin (Graham Ellis), 27 June 2005
Is it the same FTP client that you're using on the two machines?

Hard to give much of an answer without seening any source code ...

Posted by CS (CS), 28 June 2005
Please find below the source code :

---------------------
package require Expect

exp_internal 1
set exp::winnt_debug 1

set timeout 10;

spawn ftp -i;

##Put hostname or ip string here
set host 192.168.8.35;
set username hpbi;
set password hpbi123;

expect "ftp>"
exp_send "open $host\r"

expect {
  timeout
  {      
     puts "script has timed out looking for User";
  }
  "User "
   {
      exp_send "$username\r"
    }
}

expect {

timeout {
 puts "script has timed out looking for Password";
}

"Password" {
 exp_send "$password\r"
 puts "\nFound Password string";
}

}

expect {
     timeout {
        puts "Failed to validate account on remote site : Timed out.";
     }
     "421 Service not available" {
        puts "Failed to validate account on remote site : Service not available.";
     }
     "530 Login incorrect" {
        puts "Failed to validate account on remote site: Login incorrect.";
     }
     "530 User $username cannot log in" {
        puts "Failed to validate account on remote site : Login incorrect.";
     }
     "230 User $username logged in" {
        set outcome 1;
        puts "Validated account  on remote site ";
     }
}

puts "finito";
------------------

Posted by admin (Graham Ellis), 28 June 2005
Does the FTP work manually on the machine that's causing the problem?  Is the FTP client in the path?

Posted by CS (CS), 28 June 2005
Yes the FTP is working fine manually.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2022: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho