[brailleblaster] more on spawning processes

  • From: "qubit" <lauraeaves@xxxxxxxxx>
  • To: <brailleblaster@xxxxxxxxxxxxx>
  • Date: Tue, 7 Dec 2010 17:17:51 -0600

Wow, I'm just now this afternoon getting to the brailleblaster code.  I had 
something important come up that I had to take care of all morning.

Also, hope you don't mind an off topic announcement -- my niece is even now 
in labor with her first baby.  It is a boy they will name Benjamin.  He 
should be arriving sometime tonight or tomorrow.  First baby in his 
generation.  It is very exciting -- so hope you'll forgive this diversion. 
But look at it this way -- you could say my niece is in the "spawning 
process".  (More seriously, happy thoughts and prayers if you say them are 
welcome.)

Anyway, back to java, it appears that java defines a platform independent 
way of running a filter and feeding it input and collecting its output in 
buffers.  This will make it possible to run the itex2MML command completely 
independently rather than cutting into the code to make a JNI library.
Hopefully it can come in handy for other utilities as well.

I did run across something that looks erroneous in the java class 
documentation online.  In particular, there are 3 functions that set up 
pipes to manage standard in, out and err:

abstract InputStream getErrorStream()
              Gets the error stream of the subprocess.
abstract InputStream getInputStream()
    gets the input stream of the subprocess
abstract OutputStream getOutputStream()
    get output stream of subprocess

Note the return types are inconsistent.  The first declaration is right, but 
the second and third should have swapped return types (if I'm interpreting 
this right).

I haven't tried compiling any code yet as I'm still writing it.  I hope this 
is the right approach.  I did a fair amount of googling and reading of 
opensource projects, but for our purposes, I think just using the process 
classes in java.lang is sufficient.

Any objections send to the list.
Thanx and happy hacking.
--le


Other related posts: