D
Daniel Flores
i have been trying to recieved the output of a command with IO.popen and
it works great but if i place a unknown command to the system the ruby
program terminates.
def comando ( inputcmd )
f = IO.popen(inputcmd)
output = f.readlines
return output
end
#########################################################
there is a loop calling the method like this:
#########################################################
cliente.puts "Escriba el comando a ejecutar por cmd.exe: "
inputcmd = cliente.gets
cliente.puts comando( inputcmd )
any help will be appreciated!!
Thank you!
it works great but if i place a unknown command to the system the ruby
program terminates.
def comando ( inputcmd )
f = IO.popen(inputcmd)
output = f.readlines
return output
end
#########################################################
there is a loop calling the method like this:
#########################################################
cliente.puts "Escriba el comando a ejecutar por cmd.exe: "
inputcmd = cliente.gets
cliente.puts comando( inputcmd )
any help will be appreciated!!
Thank you!