I spotted a difference between MRI and JRuby while working on windows.
The
following works on MRI, not on JRuby:
wmic PROCESS get Processid,CommandLine
wmic is a built-in Windows tool to achieve all sorts of things, here I
list
running processes.
My belief is that there is some temporary batch file created by wmic -
this
may fail because of that. I will try via popen or something similar and
see
if it works.
I assume nobody really came accross this very specific thing - yet
should I
open an issue ?
On Mon, Mar 1, 2010 at 11:20 AM, Thibaut Barrère [email protected] wrote:
My belief is that there is some temporary batch file created by wmic - this
may fail because of that. I will try via popen or something similar and see
if it works.
I assume nobody really came accross this very specific thing - yet should I
open an issue ?
This works for me on JRuby 1.4 and 1.5.0.dev just fine.
What kind of error are you seeing?
I’m using jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3)
(Java
HotSpot™ Client VM 1.6.0_16) [x86-java]�
If I put this in test.rb:
wmic PROCESS get Processid,CommandLine
And launch this:
jruby test.rb
the execution is just paused, like if the process was waiting for
something
to terminate.
I also tried jruby -J-Djruby.debug.launch=true test.rb (but I have
version
1.4.0 and can’t install jruby dev there for the moment, I don’t know if
this
property applies there), same output.
Using IO.popen works though…
I’ll see if I can investigate more later on, my time is pretty
constrained
right now.
Can you guys toss this into a bug? Others have reported that backtick
seems to block or pause as well. Ideally if you can provide a
reproducible case that doesn’t require us to install some weird
program or library, that would be best.
Can you guys toss this into a bug? Others have reported that backtick
seems to block or pause as well. Ideally if you can provide a
reproducible case that doesn’t require us to install some weird
program or library, that would be best.
Can you guys toss this into a bug? Others have reported that backtick
seems to block or pause as well. Ideally if you can provide a
reproducible case that doesn’t require us to install some weird
program or library, that would be best.
I kept the wmic example - although I didn’t know much about that beast
until
a few days ago, wmic is apparently bundled on most Windows machines
(plus I
have no other example that fail that way handy).
– Thibaut
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.