Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4431178

FileOutputStream(File file,boolean append) no longer appends text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • core-libs
    • beta
    • x86
    • linux, windows_nt, windows_2000
    • Verified

      J:\jtest>java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b56)
      Java HotSpot(TM) Client VM (build B56, mixed mode)


      Consider the following program:

      import java.io.*;
      public class OpenApp {

          public static void main(String[] args) throws Throwable{
              OutputStream outStream = new FileOutputStream("tmp");
              Writer wr = new OutputStreamWriter(outStream);
              wr.write("ab");
              wr.close();

              outStream = new FileOutputStream("tmp",true);
              wr = new OutputStreamWriter(outStream);
              wr.write("cd");
              wr.close();
          }
      }

      J:\jtest>javac OpenApp.java
      J:\jtest>java OpenApp
      J:\jtest>type tmp
      cd

      The second open of the file does not append even if it is told
      to do so.

            mmcclosksunw Michael Mccloskey (Inactive)
            mzaudousunw Menasse Zaudou (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: