Details

    • Type: Sub-task Sub-task
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Number of attachments :
      0

      Description

      popen("-") is not supported in JRuby yet

      Error:

        5) Error:
      test_s_popen_spawn(TestIO):
      IOError: Cannot run program "-" (in directory "/Users/headius/NetBeansProjects/jruby"): -: not found
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `run'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run_suite'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `start_mediator'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit.rb:278:in `run'
          /Users/headius/NetBeansProjects/jruby/lib/ruby/1.8/test/unit.rb:276
      

      Test:

        def test_s_popen_spawn
          unless WIN32
            # Spawn an interpreter - WRITE
            parent = $$
            pipe = IO.popen("-", "w")
            
            if pipe
      	begin
      	  assert_equal(parent, $$)
      	  pipe.puts "12"
      	  Process.wait pipe.pid
      	  assert_equal(12, $?>>8)
      	ensure
      	  pipe.close
      	end
            else
      	buff = $stdin.gets
      	exit buff.to_i
            end
            
            # Spawn an interpreter - READWRITE
            parent = $$
            p = IO.popen("-", "w+")
            
            if p
      	begin
      	  assert_equal(parent, $$)
      	  p.puts "Hello\n"
      	  assert_equal("Goodbye\n", p.gets)
      	  Process.wait
      	ensure
      	  p.close
      	end
            else
      	puts "Goodbye" if $stdin.gets == "Hello\n"
      	exit
            end
          end
        end   
      

        Activity

        Hide
        Vladimir Sizikov added a comment -

        For now, IO.popen("-") raises NotImplementedError instead of IOErorr (rev. 5849).

        Show
        Vladimir Sizikov added a comment - For now, IO.popen("-") raises NotImplementedError instead of IOErorr (rev. 5849).
        Hide
        Charles Oliver Nutter added a comment -

        Removing target release from issues that fit any of the following criteria:

        • No known way to fix them
        • Java integration enhancements out of scope for 1.1 release
        • Other out of scope issues for 1.1
        Show
        Charles Oliver Nutter added a comment - Removing target release from issues that fit any of the following criteria: No known way to fix them Java integration enhancements out of scope for 1.1 release Other out of scope issues for 1.1
        Hide
        Charles Oliver Nutter added a comment -

        Because popen('-') in all forms requires 'fork', we will not support it. MRI does not support it on all platforms either.

        Show
        Charles Oliver Nutter added a comment - Because popen('-') in all forms requires 'fork', we will not support it. MRI does not support it on all platforms either.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Charles Oliver Nutter
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: