kanchana vasudevan wrote:
Hello Sir,
The example which you had sent was very helpful. In this
regard, I would like to know how the variables 'In/Out' are assigned to
the file descriptors in the command
{OS.pipe 'ps' ['-A'] Pid In#Out} and how it can be reassigned to
multiple files?
The documentation states that OS.pipe has two inputs and two outputs.
In the call
{OS.pipe CmdV ArgsVs PidI StatusT}
CmdV is the command to run, ArgsVs is the list of parameters of the
command. When the call returns, PidI is unified with the process id
number, and StatusT is unified with a tuple of two integers, like 5#6.
The tuple of integers can be unified with a tuple of variables. So if
you call OS.pipe with
{OS.pipe 'ps' ['-A'] Pid In#Out}
and the second output is 5#6, there will be a unification In#Out=5#6,
which will assign the variables In and Out as: In=5 and Out=6. It is as
simple as that.
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users