}
public void apply(final RippleList arg,
final Sink<RippleList> solutions,
final ModelConnection mc) throws RippleException {
RippleList stack = arg;
String command = mc.toString(stack.getFirst());
stack = stack.getRest();
int exitCode;
String normalOutput;
String errorOutput;
Runtime r = Runtime.getRuntime();
try {
Process p = r.exec(command);
exitCode = p.waitFor();
normalOutput = readInputStream(p.getInputStream(), OUTPUT_MAXLEN);
errorOutput = readInputStream(p.getErrorStream(), OUTPUT_MAXLEN);
} catch (IOException e) {
throw new RippleException(e);
} catch (InterruptedException e) {
throw new RippleException(e);
}
solutions.put(
stack.push(mc.valueOf(exitCode))
.push(mc.valueOf(normalOutput))
.push(mc.valueOf(errorOutput)));
}