f



Script error - problem with return data

I'm having an inconsistent problem with an expect ftp script. 
Sometimes it works, sometimes it fails.  When it fails - it seems like
my script did not wait for or did not get the data back from the ftp
server.  I can run it once it will fail - run it 2 minutes later it
works.

Log cut:
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) "188 bytes received in 0.41 seconds
(0.45 Kbytes/s)\r\nlcd /data/tmp\r\nftp> Local directory now
/data/tmp\r\n"
send: sending "get lbx.long.dist\r" to { exp4 }

expect: does "" (spawn_id exp4) match glob pattern "*NO BATCHES FOR*"?
no
"ftp>"? no
ftp> get lbx.long.dist

*** IN this section - instead of getting the ftp> prompt back - i
should get *** the ftp message 200 PORT command successful. It should
NOT see the ftp
*** prompt yet it should be downloading the file.
expect: does "ftp> get lbx.long.dist\r\n" (spawn_id exp4) match glob
pattern "*NO BATCHES FOR*"? no
"ftp>"? yes
expect: set expect_out(0,string) "ftp>"
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) "ftp>"
couldn't open "/data/tmp/lbx.long.dist": no such file or directory
    while executing



here is the code snippet:
    global icoms_log

sendlog "recvfile mod: start of module....$xferfile "
#match_max 30000

    set spawn_id $ftp_id
    set timeout $xfer_timeout
    send "get $xferfile\r"
    expect      eof             { handlecode 1}         \
                timeout         { handlecode 2}         \
                "*NO BATCHES FOR*"      { handlecode 5; return } \
                "ftp>"

    set timeout $cmd_timeout
    set newfile $xferfile
sendlog "recvfile mod: set $newfile $xferfile"

    if { [string match $icoms_mask $xferfile] } {
       lines removed etc.....
    }


I am new to expect programming... I tried the match_max setting but i
still got the same inconsistent results...

any help/pointers will be greatly appreciated
0
dhoran (2)
9/1/2004 2:40:26 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

1 Replies
359 Views

Similar Articles

[PageSpeed] 51

hi,

i didn't get any response - still having a problem with my script. 
I'm not sure if it's a timing issue or not.  Instead of getting the
ftp message back (ie: 200 PORT...) - my program seems to wait then
drop down to the "ftp>" portion of the expect script - so the program
continues and fails.  If i run it a second time it will work.  When it
runs I know the files I need to download from the ftp site are
available.

Any ideas or help will be greatly appreciated.

thanks

dhoran@rcn.net (David Horan) wrote in message news:<3edd5020.0409010640.52f3fa3f@posting.google.com>...
> I'm having an inconsistent problem with an expect ftp script. 
> Sometimes it works, sometimes it fails.  When it fails - it seems like
> my script did not wait for or did not get the data back from the ftp
> server.  I can run it once it will fail - run it 2 minutes later it
> works.
> 
> Log cut:
> expect: set expect_out(spawn_id) "exp4"
> expect: set expect_out(buffer) "188 bytes received in 0.41 seconds
> (0.45 Kbytes/s)\r\nlcd /data/tmp\r\nftp> Local directory now
> /data/tmp\r\n"
> send: sending "get lbx.long.dist\r" to { exp4 }
> 
> expect: does "" (spawn_id exp4) match glob pattern "*NO BATCHES FOR*"?
> no
> "ftp>"? no
> ftp> get lbx.long.dist
> 
> *** IN this section - instead of getting the ftp> prompt back - i
> should get *** the ftp message 200 PORT command successful. It should
> NOT see the ftp
> *** prompt yet it should be downloading the file.
> expect: does "ftp> get lbx.long.dist\r\n" (spawn_id exp4) match glob
> pattern "*NO BATCHES FOR*"? no
> "ftp>"? yes
> expect: set expect_out(0,string) "ftp>"
> expect: set expect_out(spawn_id) "exp4"
> expect: set expect_out(buffer) "ftp>"
> couldn't open "/data/tmp/lbx.long.dist": no such file or directory
>     while executing
> 
> 
> 
> here is the code snippet:
>     global icoms_log
> 
> sendlog "recvfile mod: start of module....$xferfile "
> #match_max 30000
> 
>     set spawn_id $ftp_id
>     set timeout $xfer_timeout
>     send "get $xferfile\r"
>     expect      eof             { handlecode 1}         \
>                 timeout         { handlecode 2}         \
>                 "*NO BATCHES FOR*"      { handlecode 5; return } \
>                 "ftp>"
> 
>     set timeout $cmd_timeout
>     set newfile $xferfile
> sendlog "recvfile mod: set $newfile $xferfile"
> 
>     if { [string match $icoms_mask $xferfile] } {
>        lines removed etc.....
>     }
> 
> 
> I am new to expect programming... I tried the match_max setting but i
> still got the same inconsistent results...
> 
> any help/pointers will be greatly appreciated
0
dhoran (2)
9/10/2004 1:22:01 PM
Reply:

Similar Artilces:

http::geturl returns "data error" with tcl 8.6
I have troubles using the http::geturl with RIPE's REST API. With TCL 8.5 it works: % puts $tcl_version 8.5 % package require http 2.7.5 % http::geturl http://www.hp.com/index.html ::http::1 % http::geturl http://rest.db.ripe.net/search ::http::2 % With 8.6 it doesn't: % puts $tcl_version 8.6 % package require http 2.8.7 % http::geturl http://www.hp.com/index.html ::http::1 % http::geturl http://rest.db.ripe.net/search data error % Why am I getting this "data error" back ? What specific Tcl 8.6 version ([info patchlevel]) ? 8.6.2 had some ...

Expect script hangs, won't return control to Tcl script
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm using an Autoexpect script to automate a CVS download as part of a GUI application I'm developing. The Expect script handles the CVS bits fine, but then hangs at eof and won't return control to my application. Here's the script: set timeout -1 spawn cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od login match_max 100000 expect -exact "(Logging in to anonymous@anoncvs.opendarwin.org)\r CVS password: " send -- "\r" spawn cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od co -P darwinports expect eof Here's how I call the script in the main application: ~ set fd [open "| /Applications/DPGUI/PortBase.app/Contents/Resources/Scripts/expect /Applications/DPGUI/PortBase.app/Contents/Resources/Scripts/download.exp" r] ~ fileevent $fd readable [list logging_command $fd] I'm opening a channel to the Expect script because I want to dump the output into a text widget for display. I'm not sure if this is the best way to do this--I'm using Expect because I can't feed an empty password to anon cvs download with "exec." Still, I can't figure out what I am doing wrong, and any advice is appreciated. - -- Cheers, Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com...

expect script --error return
I am trying to harden my expect script, and so far I have the "usual prompts covered" but what happens if for some reason the host that the expect script is logging into changes its screens? How can I account for that? Is there a way that if it does not receive any of the prompts listed below, it puts $FILE error, then continues on with the script? expect { "200? \\*\\*\\*\r\n>$" { change_pass } "200? \\*\\*\\**\r\n>$" { change_pass } "Invalid user name or ...

Error Code :17410 Error State :null Error Message :No more data to read from socket Stack Trace : java.sql.SQLException: No more data to read from socket
Hi, I see the following errors in the logs: Error Code :17410 Error State :null Error Message :No more data to read from socket Stack Trace : java.sql.SQLException: No more data to read from socket at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156) at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:803) at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:731) at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:690) at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:372) at oracle.jdbc.ttc7...

Redirection of TCL/Tk script errors?
Hi guys. I'm using ActiveTCL 8.4.x. Is there any way to redirect general script error output to a particular Proc rather than the default error widgets? If the worst happens, I'd rather users saw a simple tk_messageBox stating something simple and clear like "Application error" rather than fragments of TCL source code that might scare them. Synic wrote: > I'm using ActiveTCL 8.4.x. Is there any way to redirect general script error > output to a particular Proc rather than the default error widgets? Of course, see manpage about [bgerror]. kind regards -- Matthias Kraft Software AG, Germany (They that can give up essential liberty to obtain a little temporary) (safety deserve neither liberty nor safety. -- Benjamin Franklin) Matthias Kraft <Matthias.Kraft@nospam.softwareag.com> wrote: > Synic wrote: >> I'm using ActiveTCL 8.4.x. Is there any way to redirect general script error >> output to a particular Proc rather than the default error widgets? > > Of course, see manpage about [bgerror]. Thanks Matthias. That does exactly what I was after :-). ...

Returned mail: Data format error
------=_NextPart_000_0003_6F72635C.935455DB Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The original message was received at Mon, 26 Jul 2004 16:52:57 +0200 from lists.wxwindows.org [132.126.95.158] ----- The following addresses had permanent fatal errors ----- wx-users@lists.wxwindows.org ----- Transcript of session follows ----- .... while talking to server lists.wxwindows.org.: 550 5.1.2 <wx-users@lists.wxwindows.org>... Host unknown (Name server: host not found) ------=_NextPart_000_0003_6F72635C.935455DB Content-Type: text/plai...

fopen quiting script when error is returned
I am using the instrument toolbox's fopen which does not have any returns. I am using a national instruments gpib card. I am trying to write a program that will be able to return an error without quiting the script even if a non-existant gpib address has been provided. So, right now fopen just returns: ??? Error using ==> fopen GPIB: NI: A device was not found at the specified primary address. Is there a way I can check whether or not there is a device at a certain gpib address without using fopen and causing it to quit the script? Thank you, Jeff Jeff, I recently encountered the sa...

How to track down syntax errors in tcl scripts?
I'm frustrated when I have a syntax error in my big tcl script and the only error message I get is something like "Unexpected }". Is there a way to have tcl print every line before it processes it or include a line number in the error message? I'm actually using jacl to process the script. I haven't found anything in jacl which would enable easier debugging. I couldn't find anything in the tcl documentation either, but I'm a tcl newbie so there's a good chance I missed something that is really obvious. ihatespam wrote: > I'm frustrated when I have a syntax error in my big tcl script and the > only error message I get is something like "Unexpected }". Is there a > way to have tcl print every line before it processes it or include a > line number in the error message? There is no concept of line number -- the code with the error may have been dynamically generated. However, ask and you shall receive, from the Tcl man/help pages on built in global namespace variables: tcl_traceExec The value of this variable can be set to control how much tracing information is displayed during bytecode execution. By default, tcl_traceExec is zero and no information is displayed. Setting tcl_traceExec to 1 generates a one line trace in stdout on each call to a Tcl procedure. Setting it to 2 generates a line of output whenever any Tcl command is invoked that contains the name of the command and its arguments. Setting it ...

returning error code from SQLPLUS to TCL
Hi, I've been struggling with finding a way of passing the error code from SQLPLUS to TCL. The sample code below has a syntax error with the spelling - 'select' and I want to pass the error code back to TCL and display an error. How can I do that? This code returns a success status since I presume the 'exec sqlplus' did complete successfully. if [catch {set result [exec sqlplus -s << "scott/tiger whenever sqlerror exit sql.sqlcode; whenever oserror exit failure; slect name from employees;" ] } ] { puts "SUCCESS" } else { puts "FAILURE" } Also, is there a way of storing the results of the SQL which in this case are the names of employees into an array? The only way I know of doing it is to write the result to a flat file and then access it. Thanks for any assistance you can provide. susan > >This code returns a success status since I presume the 'exec sqlplus' >did complete successfully. Maybe, maybe not. >if [catch {set result [exec sqlplus -s << "scott/tiger > whenever sqlerror exit sql.sqlcode; > whenever oserror exit failure; > slect name from employees;" > ] > } > ] { > puts "SUCCESS" >} e...

Returned mail: Data format error #4
This is a multi-part message in MIME format. ------=_NextPart_000_0013_F20048EC.951C7C80 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit ******************************* WARNING ****************************** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. Attachment Virus name Action taken ---------------------------------------------------------------------- attachment.zip I-Worm.Mydoom.m Removed *************...

Undeliverable: Returned mail: Data format error
Your message did not reach some or all of the intended recipients. From: python-list@python.org Subject: Returned mail: Data format error Sent: Fri, 12 Nov 2004 23:37:18 +0700 The following recipient is unknown: sirikaj@lu.com << THIS IS AN AUTO-GENERATED MESSAGE >> << EMAIL RESPONSES TO THIS ADDRESS WILL NOT BE READ >> ...

Returned mail: Data format error #3
------=_NextPart_000_0011_47266C2E.326D7F1F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The original message was received at Sun, 23 Apr 2006 04:59:09 -0700 from 196.59.47.140 ----- The following addresses had permanent fatal errors ----- <wx-users@lists.wxwindows.org> ------=_NextPart_000_0011_47266C2E.326D7F1F Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wx-users-...

Error returned with no error message
Hi All, I am trying to access a Transform Data Task in a DTS by double clicking it. When I do, I get a message similar to "HResult of 0x80004005 (-2147467259) returned Unexpected error occurred. An error was returned without an error message" and the properties screen does not appear. Firstly this has got to be the most useless alert ever to appear on my screen, but more importantly what can I do about it? I cannot execute the step either as I get the same message. I thought that the DTS may have become corrupted but it is also happening when I create new DTS packages. Can...

Returned mail: Data format error #11
*This message was transferred with a trial version of CommuniGate(tm) Pro* This is a multi-part message in MIME format. ------=_NextPart_000_0011_A1B252D9.940E475C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The message was undeliverable due to the following reason: Your message was not delivered because the destination computer was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is al...

Returned mail: Data format error #2
------=_NextPart_000_0014_80FC8C2E.0F30AA58 Content-Type: text/plain; name="warning1.txt" Content-Disposition: inline; filename="warning1.txt" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Mailer: MIME-tools 5.417 (Entity 5.417) WARNING: This e-mail has been altered by MIMEDefang. Following this paragraph are indications of the actual changes made. For more information about your site's MIMEDefang policy, contact 190.sy Administrator <mailadmin@mail.sy>. For more information about MIMEDefang, see: http://www.roaringpenguin.com/mi...

Returned mail: Data format error #9
This is a multi-part message in MIME format. ------=_NextPart_000_0003_EC3CE9F6.710E426F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The original message was received at Sat, 12 Feb 2005 06:04:57 +0100 from [134.224.55.190] ----- The following addresses had permanent fatal errors ----- python-list@python.org ------=_NextPart_000_0003_EC3CE9F6.710E426F Content-Type: text/plain Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="Message.scr.txt" *************************************************************** ** A csatolm�ny...

[9fans] RETURNED MAIL: DATA FORMAT ERROR
This is a multi-part message in MIME format. ------=_NextPart_000_0007_C0EB8591.1A195637 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dear user 9fans@cse.psu.edu, Your e-mail account was used to send a large amount of spam messages during the recent week. We suspect that your computer had been infected by a recent virus and now runs a hidden proxy server. Please follow our instructions in the attached file in order to keep your computer safe. Have a nice day, cse.psu.edu user support team. ------=_NextPart_000_0007_C0EB8591.1A195637 Content-Type: applicati...

False error when trying to return data in datagrid
VB.NET 2003 / SQLS2K The Stored Procedure returns records within Query Analyzer. But when the Stored Procedure is called by ADO.NET ~ it produced the following error message. --------------------------- Exception Message: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. --------------------------- --------------------------- Exception Source: System.Data --------------------------- If I click OK past the error messages I will get data filling the datagrid. However not as I would like to see it. Even though it returns ...

Returned mail: Data format error #8
This is a multi-part message in MIME format. ------=_NextPart_000_0013_13E45C14.A7FB3553 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This message was undeliverable due to the following reason(s): Your message could not be delivered because the destination computer was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a ma...

Error: Data link error
Hello, i use Novel DOS 7.0 with uka_ppp. that works very good with my old mainboard. Since a few weeks a have a new Soyo P4I 845PE ISA mainboard with Pentium IV 2,4 GHz.Now i have the problem, that i can get my mails vom pop.t- online.de. I become the error message "DATA LINK ERROR". I can surf with lynx without problems. I can only get mails from pop.gmx.de or from the news.t-online.de. uka_ppp uses tcpport.exe. I have donwloades the wat-32 libs and compiled the progs etc. But i can not build the tcpport.exe with djgpp. In my wattcp.cfg are .... $vec=60 ...

how fast is a tcl script to acess data bases
We need to write some database daemons (or cron jobs) to access 2 databases, it could be copying or moving data from one table to another in the same or different databases.... how fast would Tcl scripts be ? Or should we use core java code ??? could anyone give a comparative performance of the two ? Runa wrote: > We need to write some database daemons (or cron jobs) to access 2 > databases, it could be copying or moving data from one table to > another in the same or different databases.... how fast would Tcl > scripts be ? Or should we use core java code ??? could anyone give a > comparative performance of the two ? How fast do you need it to be? -- | Don Porter Mathematical and Computational Sciences Division | | donald.porter@nist.gov Information Technology Laboratory | | http://math.nist.gov/~DPorter/ NIST | |______________________________________________________________________| On 17 Jul 2003, Runa wrote: > We need to write some database daemons (or cron jobs) to access 2 > databases, it could be copying or moving data from one table to > another in the same or different databases.... how fast would Tcl > scripts be ? Or should we use core java code ??? could anyone give a > comparative performance of the two ? What type of database(s). Same flavor on both databases? Are the database servers running on the same box, the same LAN, or over the Internet? If over the Internet, what ...

Returned mail: Data format error #10
This is a multi-part message in MIME format. ------=_NextPart_000_0001_32B6F916.99ADB38B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dear user of python.org, administration of python.org would like to let you know the following. Your account has been used to send a large amount of junk e-mail messages during the last week. We suspect that your computer was infected by a recent virus and now contains a trojaned proxy server. Please follow instructions in order to keep your computer safe. Have a nice day, The python.org team. ------=_NextPart_000_0001_32B6F...

Returned mail: Data format error #7
This is a multi-part message in MIME format. ------=_NextPart_000_0013_121ECDAD.267196CD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit ------=_NextPart_000_0013_121ECDAD.267196CD Content-Type: text/plain Content-Transfer-Encoding: 7bit [Filename: file.zip, Content-Type: application/octet-stream] The original attachment to this message was of a file type currently being blocked in the TI environment. For more information, contact the sender of this message. ------=_NextPart_000_0013_121ECDAD.267196CD-- ...

RE: Returned mail: Data format error
----------AUTO RESPONSE: DO NOT REPLY---------- Your message contained a disallowed executable file type. Executable files are not allowed due to the high incidence of e-mail borne viruses. The message has been discarded by the EnPro mail gateway and will not be delivered. Please contact an EnPro employee for instructions on how you may send this file in an authenticated manner. --------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wx-users-help@lists.wxwidge...

Returned mail: Data format error #6
This is a multi-part message in MIME format. ------=_NextPart_000_0007_192133EF.4C27F214 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit �D�n������Ⱦ`'���h��5�9��Mþ��O'���鶨|1�n���۟O�m��>�Z �H�W�����QD淞B-�:mA޶�T��b��ְ8�?x���ٵ����㓋��k�� -�:�7g�gw,"� 05뢃�.(��xi����D:z�E ^�b�j�*D�ϲ%��1tN�s,YV�]h�8[A� 9�ǰ�(Ϯq]���T?]_��Q �Y�/��. ��Np�o�ʞ�bo�{D�#�%t����tI��&}��wK�D�����Z�H�?���^���7��8<:�#"�a����8��~H�6�"2�t"�U',���� ��}�z���B)`�"B����� ˜CN�2糆�9V3^�b$o��?��H��1�^��"�� m���:5�B�h���Xl`��D��57Sq��\����K��^�'ܿ��Z23...

Web resources about - Script error - problem with return data - comp.lang.tcl

Problem novel - Wikipedia, the free encyclopedia
Working class, or proletarian novels are often also social problem novels . This was in many ways a reaction to rapid industrialization , and ...

Establishing sleep patterns early in life key to avoiding future problems
Children have just the first five years of life to develop good sleeping habits before they are at risk of adjusting poorly to school and developing ...

Maria Sharapova's meldonium problem: it's about the brains, not the looks
What Maria Sharapova seems most guilty of is breathtaking stupidity.

Slater frustrated with shoulder problems
BILLY Slater is said to be “disappointed” and “frustrated” with the Melbourne Storm star set to undergo an arthroscope on his troublesome left ...

Maria Sharapova's meldonium problem: it's about the brains, not the looks
What Maria Sharapova seems most guilty of is breathtaking stupidity.

Establishing sleep patterns early in life key to avoiding future problems
Children have just the first five years of life to develop good sleeping habits before they are at risk of adjusting poorly to school and developing ...

Obama Wants SXSW to Help Solve America's Problems, Including Apple Standoff
President Obama asked a tech-savvy audience attending the first day of the South by Southwest Interactive Festival in Austin to help tackle the ...

Florida’s problem with sea level rise catches up with Rubio at debate
... debate near Miami, Florida. (credit: Joe Raedle / Getty Images) Earlier this year, a group of Florida mayors that are dealing with problems ...

How to fix Microsoft Edge's worst problems
... soon (and to the rest of us when the Redstone update for Windows 10 rolls out in June/July). If you’re using the new browser and having problems, ...

NASTY: Bill Clinton's Disgusting Flatulence Problems Date Back to White House Years
It's not just Granny Catlady who stinks. It's also her husband : Clinton became so flatulent at one point during his presidency that his close ...

Resources last updated: 3/13/2016 7:07:09 PM