create stdout and stderr fodlers when not exists

This commit is contained in:
honfika@gmail.com
2015-07-19 06:30:38 +02:00
parent a9fe6d3d92
commit b874c02db7

View File

@@ -1106,11 +1106,15 @@ public class CommandLineArgumentParser {
for (File inFile : inFiles) {
String inFileName = Path.getFileNameWithoutExtension(inFile);
if (stdOut != null) {
System.setOut(new PrintStream(new FileOutputStream(stdOut.replace("{swfFile}", inFileName), true)));
String outFilePath = stdOut.replace("{swfFile}", inFileName);
Path.createDirectorySafe(new File(outFilePath).getParentFile());
System.setOut(new PrintStream(new FileOutputStream(outFilePath, true)));
}
if (stdErr != null) {
System.setErr(new PrintStream(new FileOutputStream(stdErr.replace("{swfFile}", inFileName), true)));
String errFilePath = stdErr.replace("{swfFile}", inFileName);
Path.createDirectorySafe(new File(errFilePath).getParentFile());
System.setErr(new PrintStream(new FileOutputStream(errFilePath, true)));
Main.initLogging(Configuration.debugMode.get());
}