Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6770

The method NioGroovyMethods#write does not truncate the content of a file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.3.1, 2.4.0-beta-1
    • groovy-jdk
    • None

    Description

      The write method should truncate any content of an existing file, instead currently it is appending the text to the current content.

      Begin so the following assertion is NOT satisfied:

      def path = Paths.get('example.text')
      path.text = 'alpha'
      path.text = 'beta'

      assert path.text == 'beta'

      Attachments

        Activity

          People

            pschumacher Pascal Schumacher
            pablo72 paolo di tommaso
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: