From: Roland G. <rgi...@cp...> - 2008-02-07 11:38:39
|
>> But come to think of, I have a nifty work-around! Use "ssh -t localhost >> cmd" to spawn the command with a terminal as stdin/out and interact with >> that via open2() or open3(). How does that sound? > > I'll try that but it sounds too simple, it can't work ;-P Yes it will work. :-P And probably save you a lot of coding... > unless( ioctl( \*$fd, &TIOCGPTN, $pty ) ) { > unless( ioctl( \*$fd, &DEF_TIOCGPTN, $pty ) ) { > ioctl( \*$fd, &TIOCGPTN|0x00040000, $pty ); > > For my purpose I would drop the GLOB ref. But how do I get the defines from > unistd.h into variables my perl script. Then I could replace the function refs. Easy. Just look up the values for TIOCGPTN etc. in the .h files and put them hard-coded into you program, eg ioctl($fd, 0x47110815, $pty); But I don't recommend that, use ssh instead, because that's more reliable and portable... Hope this helps, Roland |