On Mar 25, 3:19*am, Roger Pack <rogerpack2...@gmail.com> wrote:
> > require 'win32/process'
> > Process.create(:app_name => "perl C:/bin/filepp-1.8.0/filepp.pl -c")
>
> > This fails with the error:
>
> > CreateProcess() failed:
>
> Mine seems to work ok.
>
> >> Process.create(:app_name => '"c:\Program Files\Git\bin\perl.exe" c:\installs\bin\ack.pl asdf --ruby')
>
> => #<struct Struct:
rocessInfo process_handle=1916, thread_handle=1896,
> process_id=5640, thread_id=1904>
>
> Does system("..") work with the same call?
> If you get truly desperate there's 1.9.1's "Process.spawn"
> -rp
> --
> Posted viahttp://www.ruby-forum.com/.
Thanks for the response.
This is gem code so really needs to work with older versions of ruby.
Also something I maybe should have said to begin with (was trying not
to overcomplicate the issue) is that I'm needing to capture the stdin,
stdout and stderr.
I first tried using win32-open3's Open3.popen but had issues trying to
kill the process when I was done with it so then moved onto win32/
process. I'm now looking at the systemu gem in the hope it will work
without problem.
With Open4 I make the following call on my mac with no issues.
@pid, @w, @r, @e = open4.popen4("perl C:/bin/filepp-1.8.0/filepp.pl -
c")
Does anyone know how I can do this same thing with systemu, assigning
the stdin, stdout and stderr to variables?
Oh and system(cmd) does work but I need to be able to kill the process
once I'm done r/w from its associated streams.
Appreciate any help.