Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-15-2011, 08:58 AM   #1
LQ Newbie
Registered: Mar 2011
Posts: 1

Rep: Reputation: 0
exp_i_parse_states: : file16 is not an expect channel - use spawn -open to convert


Before anything I'm glad to be here and for beeing a new member, so if I don't follow the rules as I'd have to, please forgive me.

I'm working in a new feature in a new tool that we are developping at work. This tool is built with bash scripting and expect scripting and I'm having some problems with the standard input.

In general, the architecture of this solution is very simple, there is a main process and there are 3 more running under it. These others processes are coded in expect (TCL), and run as demonds. The only thing they have to do is to expect orders, in TCL also, and execute them.

I don't have any prolblem in any case but there is something that doesn't work. When I call "interact" in one of those demonds, the system gives me the next message:

"exp_i_parse_states: : file16 is not an expect channel - use spawn -open to convert"

The main process runs in background and I think there is no stdin for it. So, in order to supply one, I give to this main process a fifo as an input (mkfifo).

After the main process creates the fifo and before call "interact", in the demond, I open the fifo as following:

log_user 1
send -- "vi -R -n $fileSelected\r"
expect "readonly" {}
set ftmpFIFO [open $tmpFIFO r]
fconfigure $ftmpFIFO -eofchar
interact -input ftmpFIFO
close $ftmpFIFO
log_user 0

What I'm trying to do is give the fifo to interact as input, because before this, when I didn't do it, interact received an eof from exp0 (standard input).

I'm not sure if I do it well, but what I want is give to the user the control of the script and let it manages a file (vi -R -n $fileSelected)

I don't know how I have to open the fifo in order to let it be a right input for interact.

Who can help me please.

Thanks and regards.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
send: spawn id exp1025 not open in tcl/expect bharatbsharma Programming 3 04-22-2010 03:04 AM
Expect interpreter, spawn and cat Ricio Programming 11 08-16-2008 06:55 PM
Unexpected curly braces in expect script spawn command & bash suid problem slinx Programming 1 05-02-2008 02:47 PM
expect -c "spawn ls" The system has no more ptys status1 Linux From Scratch 12 03-29-2008 09:51 PM
error in 6.13 binutils~ expect -c"spawn ls" sharmashikha Linux From Scratch 1 06-21-2005 12:53 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:43 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration