[clug] Pseudo terminals
bradh at frogmouth.net
Wed Jul 18 10:33:19 GMT 2007
On Wednesday 18 July 2007 17:58, Adrian Blake wrote:
> Within a Fortran program I can open up a terminal with a system command
> like: call system("xterm -T new &" , result)
> This creates a device /dev/pty/x x is some number
> I then would like to be able to direct output to that device: OPEN
> (UNIT=15, FILE="/dev/pts/x", STATUS="OLD", ACCESS="STREAM") , but how can I
> determine the value of x?
> I could do : ps -ax | grep pty/ and then pick the greatest numbered
> pty. Clumsy under program control.
> Any suggestions?
I haven't tried this, so this is a bit of a stretch, but how about creating
the pty yourself, and then passing the pty number to xterm (using -S)
I'm not sure how you would create the pty in FORTRAN (I think it has to be
upper case :-). There is a bit of information in pty(7) about how
posix_openpt() works, or maybe you could just create a helper application in
C and call that from your FORTRAN app.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20070718/2b1d0bf3/attachment.bin
More information about the linux