IDL & UNIX pipes [message #4613] |
Mon, 03 July 1995 00:00 |
ph2tjh
Messages: 2 Registered: June 1995
|
Junior Member |
|
|
Can anyone suggest any solutions or sources of information for the
following problem I am encountering?
I am developing an IDL graphical interface for a very large suite
of FORTRAN programs. Basically the IDL spawns slightly modified
versions of the FORTRAN programs and then communicates with them
via a bi-directional UNIX pipe which is created using the UNIT keyword
to the SPAWN command. This process works fine on Sun and DEC machines,
but seems to fail on an HP 9000 (the development is for all 3 platforms).
Can anyone suggest a reason/solution for this?
The method I am using therefore has roughly the following form:
IDL: spawn, 'prog1.out', unit=pipe, /noshell, PID=pid
FORTRAN: WRITE(6, *) X, Y
CALL FLUSH(6) (FFLUSH for HP) - this flushes the pipe
IDL: dummy1 = 0.0
dummy2 = 0.0
readf, pipe, dummy1, dummy2
x = dummy1
y = dummy2
Experience has shown that it is necessary to regularly 'flush' the
UNIX pipe from the FORTRAN end and that it is also unwise to read
from the pipe directly into a useful variable. This process works
fine (as I said) on Sun and DEC machines, but on an HP 9000 all I
can get out of the pipe on the IDL end are zeroes or nothing at all.
Quite an esoteric question that, but any suggestions gratefully received.
Tim Hammond.
-----------
hammond@solg2.bnsc.rl.ac.uk
|
|
|