Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Path.write() is expected to overwrite and not append, which it does, except in when the encoding parameter is passed, as demonstrated here
def p = java.nio.file.Paths.get("foo.txt") p.write("1") p.write("2") assert p.text == "2" // passes java.nio.file.Files.delete(p) p.write("1", "UTF-8") p.write("2", "UTF-8") assert p.text == "2" // fails, is '12' java.nio.file.Files.delete(p)