[Armedbear-devel] Question about pipes

Mark Evenson evenson at panix.com
Wed May 14 08:24:51 UTC 2014


On 13 May 2014, at 22:40, Sistemas <sistemas at dedaloingenieros.com> wrote:

> Thankyou, I've seen the documentation before sending my original mail :)
> I tryed to make a simple pipe with this piece of code:
>  
> (let ((p1 (system:run-program "echo" '("zero") :wait nil))
>       (p2 (system:run-program "grep" '("zero") :wait nil)))
>   (setf (system:process-input p2) (system:process-output p1))
>   (system:process-wait p1)
>   (system:process-wait p2))

Unfortunately, I don’t think that the ABCL API currently supports such
redirection although the docs misleadingly imply that such a thing should be
possible .  ABCL 1.x is implemented to the Java 5 JVM API, for which the
underlying [ProcessBuilder][1] object does not support input/output output
stream redirection.  The [Java 7 API][process-builder-java7] supports such
redirection, so you could implement the necessary abstractions using either the
low-level Java Function Interface or the higher-level JSS contrib as long as
your target runtime platform was Java 7 or better.

In general, the ABCL implementation could use a strategy for supporting such
useful primitives when they are available in the underlying platform.

Out of curiosity, is anybody actually running ABCL on Java 5 at the moment?
Oracle has designated Java 5 as obsolete at this point, but it is probably
still in use in legacy enterprise situations where migration is not possible
for one reason or another.  In my opinion, if we were to make a leap, I would
probably skip Java 6, and go straight to Java 7, as there is much greater gain
for the pain in the subjective terms of useful APIs.

[1]: http://docs.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html
[process-builder-java7]: http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html 

-- 
"A screaming comes across the sky.  It has happened before but there is nothing 
to compare to it now."






_______________________________________________
Armedbear-devel mailing list
Armedbear-devel at common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel



More information about the armedbear-devel mailing list