[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6607] popen vs. open3 vs. Windows....

From: Dave Thomas <Dave@...>
Date: 2000-11-28 19:53:03 UTC
List: ruby-talk #6607
OK, I'll admit it. I'm spinning my wheels here, and need a clunk on
the side of the head to get some traction.

I'm trying to run a subprocess, reading back its standard output and
standard error, along wth the process's exit status.

This has to work under Linux, W95, and NT.

* Attempt 1

     IO.popen(cmd + " 2>&1", "w+") do |pipe|
       pipe.puts stuff
       pipe.close_write
       result = pipe.readlines
     end
     status = $?

  This works fine under Linux and W95. However, it fails under NT. The 
  reason seems to be that the replacement for popen (mypopen in
  win32.c) notices the redirection on the command line, attempts to
  run the command with 'cmd /c' prefixed, and fails for some
  reason. (The NT version also fails to run any internal command such
  as 'dir' for the same reason).

* Attempt 2

    arr = open3(cmd)
    <stuff>

  The problem here is that the latest open3 does a fork within a fork
  (why? it can't be a session thing as there's no setsid), and there's 
  no way to get the exit status of the grandchild process.


So:

  1. Is the popen problem a known NT bug?

  2. What can I do?


Thanks


Dave

In This Thread

Prev Next