From: Tobias Reif Date: 2002-05-24T21:26:54+09:00 Subject: Re: OS independent scripts, system calls on Windows and Linux nobu.nokada@softhome.net wrote: > The backtick returns stdout only and is almostly system > independent. Then I might think about an RCR for a feature which saves me from writing stuff like [ http://ruby-talk.com/9739 ] ... if ENV.has_key?("OS") && ENV["OS"] =~ /nt/i puts "It's either NT or 2K, use 'cmd.exe /c '" if $DEBUG #it's either NT or Win2K command_shell = "cmd.exe /c " ... What do people think? I'd like to have a way more platform independent system call mechanism, in Ruby itself or in the std lib, which returns either nil, an Error object of some sort, or a Stdout object of some kind, so I can simply write something like commands = Commands.new ['this -x -y','that -a -b'] commands.each do |cmd| returned = cmd.issue # or ".run", ".enter", ... case returned when Stderr then raise returned when Stdout then puts returned end end Would others find that useful too? Tobi -- http://www.pinkjuice.com/