Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2305 Process .getText() GDK method blocks on some operating systems.
  3. GROOVY-2758

Provide better mechanisms to allow output and error streams from run process to be captured

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1-rc-3
    • 1.5.4, 1.5.5, 1.5.6
    • None
    • None

    Description

      Split off short-term enhancements for getText() deadlocking. Now allows various consumeProcessXXX variations and pipeTo:

      def sout = new StringBuffer()
      def serr = new StringBuffer()
      proc2 = 'tr -d o'.execute()
      proc3 = 'tr -d e'.execute()
      proc4 = 'tr -d i'.execute()
      proc4.consumeProcessOutput(sout, serr)
      proc2 | proc3 | proc4
      [proc2, proc3].each{ it.consumeProcessErrorStream(serr) }
      proc2.withWriter { writer ->
          writer << 'testfile.groovy'
      }
      proc4.waitForOrKill(1000)
      println 'sout: ' + sout
      println 'serr: ' + serr
      

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              paulk Paul King
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: