...
| Code Block |
|---|
def initialSize = 4096 def outStream = new ByteArrayOutputStream(initialSize) def errStream = new ByteArrayOutputStream(initialSize) def proc = "ls.exe".execute() proc.consumeProcessOutput(outStream, errStream) proc.waitFor() println 'out:\n' + outStream println 'err:\n' + errStream |
| Code Block |
|---|
def out = new StringBuilder()
def err = new StringBuilder()
def proc = "ls".execute()
proc.waitForProcessOutput(out, err)
if (out) println "out:\n$out"
if (err) println "err:\n$err"
|
Further Information
See also:
...