Questions tagged [popen3]

Open3 grants you access to stdin, stdout, stderr and a thread to wait the child process when running another program.

Open3 grants you access to stdin, stdout, stderr and a thread to wait the child process when running another program

69 questions
0
votes
1 answer

Simulating command prompt commands

"Answering a cli prompt in ruby with open3?" is a possible duplicate question but it has no answer. I need to write a program which compiles and executes a C program, gives inputs and returns the output. So far I came up with this: For single…
Azam Ikram
  • 185
  • 1
  • 1
  • 10
0
votes
2 answers

Running cmd commands through ruby

I am writing a program which execute an other program written in c, here is my first try require 'Open3' system 'tcc temp.c' Open3.popen3('temp.exe') do |stdin, stdout, stderr| stdin.puts '21\n' STDOUT.puts stdout.gets end actual…
Azam Ikram
  • 185
  • 1
  • 1
  • 10
0
votes
1 answer

How to execute subprocesses in Ruby as fast as possible?

We have a Rails application, which interfaces with iOS and web clients. Currently we are spawning subprocesses from a Rails controller using Open3 to retrieve and send data to a chat server, which running node.js with MongoDB. However, after a few…
uohzxela
  • 613
  • 4
  • 14
  • 28
0
votes
2 answers

Ruby - Open3 not finishing subprocess

I'm using: - Ruby 1.9.3-p448 - Windows Server 2008 I have a file that contains commands that is used by a program, I'm using it in this way C:\> PATH_TO_FOLDER/program.exe file.txt File.txt have some commands so program.exe will do the…
JavierQQ23
  • 704
  • 1
  • 8
  • 20
0
votes
0 answers

Ruby on Rails. Returning output of exe file to browser

First time using Ruby or Rails, so bear with me :) I am trying to output the results of an exe file to my browser, possibly with some processing before hand. I am using Open3 @stdout,@stderr,@status = Open3.capture3('c:\server.exe','') This works,…
Horse
  • 3,023
  • 5
  • 38
  • 65
0
votes
1 answer

Losing STDOUT when using Open3.capture3 and rake?

A build system that I use at work invokes several external console applications, Node.js among others. The issue I am seeing is the STDOUT channel seems to not work after Open3.capture3 is invoked. For instance, I have a task called…
MattSaw
  • 451
  • 2
  • 11
0
votes
1 answer

trying to check if command exists with ruby popen3

I am trying to check if system command exists with following code: require 'open3' Open3.popen3('non-existing command') do |stdin, stdout, stderr, thread| exit_error = stderr.readlines if exit_error["No such file or directory"] puts…
Pavel K.
  • 6,697
  • 8
  • 49
  • 80
0
votes
1 answer

Open executable and manage its streams?

I'm trying to open a Ruby script that prompts for stuff with popen3, for testing purposes. I need to be able to type into the STDIN of the proccess and inspect the outputs. So far I have this: require 'open3' def run(executable, opts = {}) …
ichigolas
  • 7,595
  • 27
  • 50
0
votes
1 answer

Ruby on Rails call to perl script timing out

I'm am writing a Ruby on Rails application that is calling a perl script using Open3. However, when calling the perl script my app keeps raising a Timeout::Error sooner than I want. The code where I call the script looks like this: …
Chris
  • 143
  • 10
1 2 3 4
5