From b874c02db793f457d6b0fd7beb53be812ead6a98 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 19 Jul 2015 06:30:38 +0200 Subject: [PATCH] create stdout and stderr fodlers when not exists --- .../flash/console/CommandLineArgumentParser.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 97b3b7aee..256a47682 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -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()); }