Ruby in windows

L

lance.sanchez

i'm trying to script administrative tasks in windows and i'm really
not feeling the ruby love, does anyone have some suggestions on a way
of running commands and catching STDERR in windows?
 
J

Jano Svitok

i'm trying to script administrative tasks in windows and i'm really
not feeling the ruby love, does anyone have some suggestions on a way
of running commands and catching STDERR in windows?

Try:
1. win32-open3 gem
2. use Kernel#system or `` (backticks) and redirect output to a file
or pipe. Windows from 2000 up supports stderr
redirection ( command 2> err.txt )
 
L

lance.sanchez

thanks, thats giving me the io objects back.

Try:
1. win32-open3 gem
2. use Kernel#system or `` (backticks) and redirect output to a file
or pipe. Windows from 2000 up supports stderr
redirection ( command 2> err.txt )
 
L

Lance Sanchez

when i run this in production it seems to die while trying to read
from the Output IO object, if its

io_in, io_out, io_err = Open3.popen('some command with parameters')

out = io_out.read (hangs here forever if the command should have worked)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top