else if (type.equals("file")) {
BinaryStream stream = FileModule.fopen(
env, name, mode, false, null);
if (stream instanceof FileOutput) {
FileOutput file = (FileOutput) stream;
out = new ProcOpenInput(env, process.getInputStream(), file);
}
else if (stream != null)
stream.close();
}
}
// place to put error output from the command
else if (key.equals(LongValue.create(2))) {
if (type.equals("pipe")) {
es = new ProcOpenInput(env, process.getErrorStream());
array.put(LongValue.create(2), env.wrapJava(es));
}
else if (type.equals("file")) {
BinaryStream stream = FileModule.fopen(
env, name, mode, false, null);
if (stream instanceof FileOutput) {
FileOutput file = (FileOutput) stream;
es = new ProcOpenInput(env, process.getErrorStream(), file);
}
else if (stream != null)
stream.close();