Daniel Bretoi wrote:
> I recently posted something to log stdout AND stderr:
> 
> require 'open3'
> def doit(command)
>    logfile = command.shift
>    threads = []
>    Open3.popen3(command.join(' ')) { |inp,out,err|
>       fh = File.open(logfile,"w")
> 
>       threads <<  Thread.new(out) { |out|
>          out.each { |line| puts line; fh.print line }
>       }
>       threads <<  Thread.new(err) { |err|
>          err.each { |line| puts line; fh.print line }
>       }
>       threads.each { |t| t.join }
>    }
>    $? >> 8
> end
> 
> exit doit(ARGV)
> 
> for example: system.rb mylslog ls
> 
> will log everything in mylslog while printing it to the stdout.
> 
> hope this helps,
> 
> db

thanks for reply, but ...

i m not familiar with open3,
i would prefer a simpler solution if possible. i would be surprised if 
this isn t possible in ruby :)