「Answering a cli prompt in ruby with open3?」是一個可能重複的問題,但它沒有答案。 我需要編寫一個程序來編譯和執行一個C程序,給出輸入並返回輸出。到目前爲止,我想出了這一點: 對於單輸入: Open3.popen3('one.exe') do |stdin, stdout, stderr|
stdin.puts "45\n"
STDOU
我有一個紅寶石腳本中途通過我需要它來運行另一個程序。 運行程序後,腳本的其餘部分不會運行。例如: # some ruby that gets run
exe = "Something.exe"
system(exe)
# some ruby that doesnt run
我一直在使用Open3.popen2e(cmd)和Open3.popen3(cmd),但其同樣也試過。 任何人都