Task

(Over)write a file so that it contains a string.



The reverse of Read entire file—for when you want to update or create a file which you would read in its entirety all at once.




 
package com.rosetta.example
 
import java.io.File
import java.io.PrintStream
 
class WriteFile {
    def static main( String ... args ) {
        val fout = new PrintStream(new File(args.get(0)))
        fout.println("Some text.")
        fout.close
    }
}
 