Can one close only one of STDIN and STDOUT when using SPAWN with the UNIT keyword? [message #83721] |
Tue, 26 March 2013 15:30 |
tom.grydeland
Messages: 51 Registered: September 2012
|
Member |
|
|
Hi all,
Some commands only produce output after all of the input has been consumed. For such a command, the usual approach when given input and output streams is to open both, feed the process all its input, close the input stream and then read the result on the output stream.
In IDL, when using SPAWN with the UNIT keyword, one file unit is supposed to be used for both directions. Is it possible to do the above from IDL?
For example, if the external command is a checksum program, like 'md5sum':
IDL> SPAWN, 'md5sum', UNIT=unit
IDL> WRITEU, unit, 'foo'
IDL> {close unit in the input-to-md5sum direction}
IDL> READU, unit, checksum
IDL> {proceed with checksum}
Can the above be done from IDL? How?
--T (tom.grydeland@norut.no)
|
|
|