Originally posted by: SystemAdmin
That is strange. What version do you use and which operating system? I tried the following program here with 12.2 and 12.3 on Linux and in both cases it sent the "Warning: Output names have been modified to conform to LP format." message to the warning stream -- just as I would have expected.
import java.io.*;
import ilog.cplex.*;
import ilog.concert.*;
public final class ErrorOut {
public static void main(String[] args) {
try {
IloCplex cplex = new IloCplex();
IloNumVar x = cplex.numVar(0, 1, "invalid name");
IloNumVar y = cplex.numVar(0, 1, "y");
cplex.addGe(cplex.sum(x, y), 3);
boolean disableOutput = true;
FileOutputStream warn = null;
FileOutputStream out = null;
if (disableOutput) {
cplex.setOut(out = new FileOutputStream("out"));
cplex.setWarning(warn = new FileOutputStream("warn"));
System.out.println("Output disabled.");
}
cplex.exportModel("model.lp");
System.out.println("Model exported");
if (warn != null) {
System.out.println("--- Output on warning stream ---");
warn.close();
FileInputStream in = new FileInputStream("warn");
byte[] buffer = new byte[1];
while (in.read(buffer) == 1)
System.out.print((char)buffer[0]);
in.close();
System.out.println("--- End of warning output ---");
}
if (out != null)
out.close();
cplex.end();
} catch (IOException e) {
System.err.println(e.getMessage());
e.printStackTrace();
System.exit(-1);
} catch (IloException e) {
System.err.println(e.getMessage());
e.printStackTrace();
System.exit(-1);
}
}
}
Can you try and run this short program? Does it redirect the message for you?
#CPLEXOptimizers#DecisionOptimization