This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
getInputStream
- From: "Walter C. Pelissero" <walter at pelissero dot org>
- To: kawa at sources dot redhat dot com
- Date: Wed, 21 Nov 2001 22:48:40 +0000
- Subject: getInputStream
- Reply-to: walter at pelissero dot org
To me these two pieces of code look equivalent
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("sleep 1000");
InputStream is = p.getInputStream();
--------------------
(define rt (invoke-static <java.lang.Runtime> 'get-runtime))
(define p (invoke rt 'exec "sleep 1000"))
(define is (invoke p 'get-input-stream))
But in the second case the last define triggers an exception:
java.lang.RuntimeException: apply not implemented for PrimProcedure java.io.InputStream java.lang.UNIXProcess.getInputStream() - java.lang.IllegalAccessException: java/lang/UNIXProcess
at gnu.expr.PrimProcedure.applyV(PrimProcedure.java, Compiled Code)
at gnu.mapping.MethodProc.applyN(MethodProc.java, Compiled Code)
at gnu.kawa.reflect.Invoke.applyN(Invoke.java, Compiled Code)
at gnu.kawa.reflect.Invoke.applyN(Invoke.java, Compiled Code)
at gnu.expr.ApplyExp.eval(ApplyExp.java, Compiled Code)
at gnu.expr.SetExp.eval(SetExp.java, Compiled Code)
at gnu.expr.Expression.eval(Expression.java, Compiled Code)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java, Compiled Code)
at kawa.Shell.run(Shell.java, Compiled Code)
at kawa.Shell.run(Shell.java, Compiled Code)
at kawa.Shell.run(Shell.java, Compiled Code)
at kawa.repl.main(repl.java, Compiled Code)
--
walter pelissero
http://www.pelissero.org