[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby in windows

lance.sanchez@gmail.com

3/2/2008 6:24:00 AM

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?

3 Answers

Jano Svitok

3/2/2008 9:49:00 AM

0

On Sun, Mar 2, 2008 at 7:24 AM, lance.sanchez@gmail.com
<lance.sanchez@gmail.com> wrote:
> 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 )

lance.sanchez@gmail.com

3/2/2008 6:11:00 PM

0

thanks, thats giving me the io objects back.

On Mar 2, 1:49=A0am, "Jano Svitok" <jan.svi...@gmail.com> wrote:
> On Sun, Mar 2, 2008 at 7:24 AM, lance.sanc...@gmail.com
>
> <lance.sanc...@gmail.com> wrote:
> > i'm trying to script administrative tasks in windows and i'm really
> > =A0not feeling the ruby love, does anyone have some suggestions on a way=

> > =A0of 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 )

lance.sanchez@gmail.com

3/3/2008 8:05:00 PM

0

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)

On Sun, Mar 2, 2008 at 10:11 AM, lance.sanchez@gmail.com
<lance.sanchez@gmail.com> wrote:
> thanks, thats giving me the io objects back.
>
> On Mar 2, 1:49 am, "Jano Svitok" <jan.svi...@gmail.com> wrote:
> > On Sun, Mar 2, 2008 at 7:24 AM, lance.sanc...@gmail.com
>
>
> >
> > <lance.sanc...@gmail.com> wrote:
> > > 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 )
>
>