How to change default stdin to a process?
Posted: Fri May 06, 2011 6:12 am
Hi,
I have two processes (one written in tcl (wish process) and the other is a C Program (a.out))
I am opening the second process as a sub process from wish process by using pipe as follows
set pipe [open "| sh -c { $execCommand } " r+ ]
So, when i want to send a message to process 2, i can use "puts $pipe <message>" and the message can be received at process2 at fd 0 . i.e., "read(0,buff,size) in process2"
Now my query is "How to change that default fd 0 at receiving side? i.e., I want to receive the message when I give read((5,buff,size)) on process2???"
Thanks in Advance,
rAzoRbaCK
I have two processes (one written in tcl (wish process) and the other is a C Program (a.out))
I am opening the second process as a sub process from wish process by using pipe as follows
set pipe [open "| sh -c { $execCommand } " r+ ]
So, when i want to send a message to process 2, i can use "puts $pipe <message>" and the message can be received at process2 at fd 0 . i.e., "read(0,buff,size) in process2"
Now my query is "How to change that default fd 0 at receiving side? i.e., I want to receive the message when I give read((5,buff,size)) on process2???"
Thanks in Advance,
rAzoRbaCK