=== modified file 'src/com/goldencode/p2j/main/ClientCore.java'
--- src/com/goldencode/p2j/main/ClientCore.java	2023-03-16 14:12:39 +0000
+++ src/com/goldencode/p2j/main/ClientCore.java	2023-03-28 15:33:39 +0000
@@ -64,6 +64,7 @@
 **                  Passing arg to spawner for path to stderr log file for background processes.
 ** 032 GBB 20230127 Fixing pid in outputToFile name by replacing it in Java code.
 ** 033 GBB 20230316 Set IS_OUTPUT_REDIRECTED flag to true on System.out redirect.
+** 034 GBB 20230316 IS_OUTPUT_REDIRECTED flag imported from its new location in FileChecker.
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -130,7 +131,6 @@
 import com.goldencode.p2j.directory.*;
 import com.goldencode.p2j.security.SecurityManager;
 import com.goldencode.p2j.ui.client.*;
-import com.goldencode.p2j.ui.client.chui.driver.batch.*;
 import com.goldencode.p2j.ui.client.driver.*;
 import com.goldencode.p2j.ui.chui.ThinClient;
 import com.goldencode.p2j.util.*;
@@ -460,7 +460,7 @@
       {
          outputToFile = outputToFile.replace("%pid%", String.valueOf(getPid()));
          System.setOut(new PrintStream(new FileOutputStream(outputToFile), true));
-         BatchHelper.IS_OUTPUT_REDIRECTED.set(true);
+         FileChecker.IS_OUTPUT_REDIRECTED.set(true);
       }
       catch (Throwable t)
       {

=== modified file 'src/com/goldencode/p2j/ui/client/chui/driver/batch/BatchHelper.java'
--- src/com/goldencode/p2j/ui/client/chui/driver/batch/BatchHelper.java	2023-03-16 14:12:39 +0000
+++ src/com/goldencode/p2j/ui/client/chui/driver/batch/BatchHelper.java	2023-03-28 15:30:01 +0000
@@ -2,7 +2,7 @@
 ** Module   : BatchHelper.java
 ** Abstract : The class provides I/O stubs and error handling for batch mode processing. 
 **
-** Copyright (c) 2013-2017, Golden Code Development Corporation.
+** Copyright (c) 2013-2023, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ---------------------------------Description----------------------------------
 ** 001 EVL 20131104 Created initial version.
@@ -11,6 +11,7 @@
 ** 003 GES 20150506 Made this into a simple static helper class.  There is no instance data.
 ** 004 IAS 20160829 outputOperation() fix.
 ** 005 GBB 20230316 Add IS_OUTPUT_REDIRECTED flag to validate System.out redirect in outputOperation.
+** 006 GBB 20230328 Move IS_OUTPUT_REDIRECTED flag to FileChecker.
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -71,8 +72,6 @@
 import com.goldencode.p2j.util.*;
 import com.goldencode.util.*;
 
-import java.util.concurrent.atomic.*;
-
 /**
  * The BatchHelper class provides special handling for input output operation for active batch
  * mode.
@@ -80,11 +79,6 @@
 public class BatchHelper 
 {
    /**
-    * A flag used to show if System.out has been redirected programmatically.
-    */
-   public static final AtomicBoolean IS_OUTPUT_REDIRECTED = new AtomicBoolean(false);
-   
-   /**
     * Default empty constructor.
     */
    private BatchHelper()
@@ -109,7 +103,7 @@
    public static void outputOperation()
    throws UnstoppableExitException
    {
-      if (!IS_OUTPUT_REDIRECTED.get() && !FileChecker.isConsoleRedirected() &&
+      if (!FileChecker.isConsoleRedirected() &&
           (!PlatformHelper.isUnderWindowsFamily() || !OutputManager.isBatchInBackground()))
       {
          ErrorManager.displayError(516,
@@ -117,4 +111,4 @@
          throw new UnstoppableExitException("");
       }
    } 
-}
\ No newline at end of file
+}

=== modified file 'src/com/goldencode/p2j/util/FileChecker.java'
--- src/com/goldencode/p2j/util/FileChecker.java	2022-10-28 10:54:33 +0000
+++ src/com/goldencode/p2j/util/FileChecker.java	2023-03-28 15:32:22 +0000
@@ -3,7 +3,7 @@
 ** Abstract : Java implementation of for detecting the file type attribute 
 *             list of OS-DIR
 **
-** Copyright (c) 2013-2022, Golden Code Development Corporation.
+** Copyright (c) 2013-2023, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ----------------Description-----------------
 ** 001 CS  20130103 Created initial version for Implement OS-DIR support as
@@ -18,6 +18,8 @@
 **                  file by command line option.
 ** 005 EVL 20160224 Javadoc fixes to make compatible with Oracle Java 8 for Solaris 10.
 ** 006 TJD 20220504 Java 11 compatibility minor changes
+** 007 GBB 20230328 Moving flag IS_OUTPUT_REDIRECTED from BatchedHelper to use it in
+**                  isConsoleRedirected().
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -73,9 +75,7 @@
 */
 package com.goldencode.p2j.util;
 
-import java.io.File;
-
-import com.goldencode.util.*;
+import java.util.concurrent.atomic.*;
 
 /**
  * Utility class that uses JNI call to get the bitfield representing the 
@@ -113,6 +113,11 @@
  */
 public class FileChecker
 {
+   /**
+    * A flag used to show if System.out has been redirected programmatically.
+    */
+   public static final AtomicBoolean IS_OUTPUT_REDIRECTED = new AtomicBoolean(false);
+   
    /** Status code for error */
    private static final int ERROR_TYPE =-1;
 
@@ -291,6 +296,6 @@
          consoleRedirected = Boolean.valueOf(isStdoutRedirected());
       }
       
-      return consoleRedirected.booleanValue();
+      return consoleRedirected.booleanValue() || IS_OUTPUT_REDIRECTED.get();
    }
 }

