versatile writeTextFile

now a String can be passed instead of a File