Use Ruby to boot the new thread and get the output.

xiaoxiao2021-03-06  87

Simple, is a major feature of Ruby, start the new thread and get the standard output is also as simple:

Output = IO.POPEN ('DIR')

This gives an IO object, you can standard IO operations on this object.

P Output.Readlines

Or, write the output to the file

f = file.new ("Output.txt", "W")

Begin

Output.each_Line DO | LINE |

F.Write Line

end

Rescue SystemCallerror

P $!

Ensure

f.close

end

转载请注明原文地址:https://www.9cbs.com/read-106382.html

New Post(0)