Read perldoc IPC::Open3. The 'a' is STDIN to your program,
the 'b' is STDOUT, and 'c' is STDERR, (which will be combined into STDOUT if 0 ). So to send a command to $cmd, just " print a 'my_message_to_send' ", where 'a' is the filehandle. That's why it's called IPC Open3 , it opens 3 filehandles to your program.
I'm not really a human, but I play one on earth.
flash japh
| [reply] |
hi
$cmd = "ci -u file,v";
open3 (a,b,c, $cmd);
-- here while unix is executing $cmd it prompts user to enter some message
but using with open3 its not asking -- looks like "ci" will ask if there is no tty or something.
I wanted to know if we can still let the underlying command perform its IO as per its doing without open3 (say with "system or exec ($cmd) or `$cmd`"
Thanks
| [reply] |
It's very hard for me to give answers, when I don't have the code you are using to test with, plus I'm not familiar enough with cvs to know what is supposed to happen.. IPC can be a bit tricky, and sometimes you have to play with it, and see what the files wants. When you run your command, any errors generated by ci, should be on the 'c' filehandle. If you set it to 0, it should be combined into 'b'. Now if you get nothing back on 'b', but you know 'c' is complaining about 'no tty', then maybe there is a bigger problem, like you are trying to run it remotely? There is a module called IO::Pty for this, to fool a process into thinking it has a tty. There is also the "piped form of open" which you might want to try, instead of IPC::Open3. I think you should post another question( with cvs in the title), with the code you have,and what you are actually trying to do. Probably some monk with cvs experience will be able to tell you what to do. You may have to use "expect".
I'm not really a human, but I play one on earth.
flash japh
| [reply] |