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

File{OutputStream,Writer} should implement atomic append mode using FILE_APPEND_DATA (win)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 7
    • core-libs
    • None
    • b25
    • generic
    • windows_2000

      It is possible to open a FileOutputStream (and FileWriter) in append mode.
      This is implemented on Windows by opening the underlying file in the ordinary way,
      and seeking to the end of the file before writing to the file.
      Presumably this was done because it was not obvious how to open a
      Windows file HANDLE in append mode.

      This technique has two deficits:

      It is not atomic. If multiple threads append to a file,
      one of the appends may get lost.

      If the underlying FileDescriptor or HANDLE is extracted from the FileOutputStream,
      it is open in ordinary write mode, so does not inherit "append mode" semantics.
      A "natively" append-mode HANDLE appears to be necessary to implement
      append mode redirection, as needed by
      4960438: (process) Need IO redirection API for subprocesses

            martin Martin Buchholz
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: