Lavanya r wrote:
Respected Members,
I want more explanation for the command |{OS.pipe ||+/CmdV/|| ||+/ArgsVs/|| ||?/PidI /|| ||?/StatusT/||}| given in the mozart documentation, especially about the parameters along with an example to run it under Windows.

Here is an example. It runs the command 'ps -A', which shows the list of all processes in Unix systems. The example reads the first 1000000 characters of the output of the command, and inspects them line by line. You should be able to adapt the example to your needs. I let you think a bit by yourself for reading more than 1000000 characters...

local Pid In Out L I in
   %% run the command 'ps'
   {OS.pipe 'ps' ['-A'] Pid In#Out}

   %% read its output from the file descriptor In
   {OS.read In 1000000 L nil I}

   %% split the string L in lines, and inspect them
   {Inspector.configure widgetShowStrings true}
   for Line in {String.tokens L &\n} do
      {Inspect Line}
   end
end


Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to