Changeset 40152 in project


Ignore:
Timestamp:
05/27/21 16:53:49 (2 months ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [78.85.4.79]: 0.2 release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/expect

    r40138 r40152  
    1616
    1717* Linux
    18 * sh
    1918* libtcl
    2019* libexpect
     
    6261<procedure>(call-with-process-io cmd proc)</procedure>
    6362
    64 Forks a new process and executes {{cmd}} via Bourne shell then call {{proc}} which should be a procedure of three arguments: the input, output, and PID of the sub-process.
     63Forks a new process and executes {{cmd}} then call {{proc}} which should be a procedure of three arguments: the input, output, and PID of the sub-process.
    6564
    6665'''Note''': The input and output ports will not be closed if {{proc}} raises an error
     
    6867While it is possible to use {{read-line}} to read information from a process spawned by {{call-with-process-io}}, more convenient function are provided.
    6968
    70 <procedure>(expect in-port pattern)</procedure>
     69<procedure>(expect in-port pattern [timeout 10])</procedure>
    7170
    7271The function waits until the output from a process matches the pattern, a specified time period has passed, or an EOF is seen.
    73 The first argument to the function is an in-port the second argument is a Tcl glob-style string pattern.
     72The first argument to the function is an in-port the second argument is a Tcl glob-style string pattern the optional third argument sets timeout. The default timeout period is 10 seconds. A value of -1 disables a timeout from occurring. A value of 0 causes the function to return immediately.
    7473
    7574Returns one of the following values
     
    7877* timeout
    7978* fullbuffer
    80 
    81 <procedure>(set-timeout secs)</procedure>
    82 
    83 Sets timeout for {{expect}} function. The default timeout period is 10 seconds. A value of -1 disables a timeout from occurring. A value of 0 causes the {{expect}} function to return immediately.
    8479
    8580=== Example
     
    10196
    10297* 0.1 Initial release
     98* 0.2
     99** set-timeout function has been removed
     100** spawn function no longer uses 'sh' to execute commands
     101** expect function now takes an optional third argument - timeout
    103102
    104103=== License
Note: See TracChangeset for help on using the changeset viewer.