Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-744

FileWriterWithEncoding for an existing file no longer truncates the file.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.11.0
    • 2.12.0
    • Streams/Writers
    • None

    Description

      Creating a new FileWriterWithEncoding for an existing file no longer truncates the file. This was the case in the versions before including 2.10.0.

      Starting with 2.11.0 i'm facing issues with files containing my new content but still have the old one if the existing file was larger than the new content.

       

      commit b2811e86 seems to introduce the problem - i think we should use StandardOpenOption.CREATE_NEW instead of StandardOpenOption.CREATE (inside the initWriter method)

       

      Please give me a sign if you  need more details.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rbri Ronald Brill
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h
                2h