src/Pure/General/file.scala
changeset 72378 075f3cbc7546
parent 72036 e48a5b6b7554
child 72442 90868036d693
equal deleted inserted replaced
72377:c7741f767e3e 72378:075f3cbc7546
   267     if (path.is_file) move(path, path.backup2)
   267     if (path.is_file) move(path, path.backup2)
   268     write(path, text)
   268     write(path, text)
   269   }
   269   }
   270 
   270 
   271 
   271 
       
   272   /* change */
       
   273 
       
   274   def change(file: JFile, f: String => String): Unit = write(file, f(read(file)))
       
   275   def change(path: Path, f: String => String): Unit = write(path, f(read(path)))
       
   276 
       
   277 
   272   /* append */
   278   /* append */
   273 
   279 
   274   def append(file: JFile, text: CharSequence): Unit =
   280   def append(file: JFile, text: CharSequence): Unit =
   275     Files.write(file.toPath, UTF8.bytes(text.toString),
   281     Files.write(file.toPath, UTF8.bytes(text.toString),
   276       StandardOpenOption.APPEND, StandardOpenOption.CREATE)
   282       StandardOpenOption.APPEND, StandardOpenOption.CREATE)