adapted AppendAllText
adapted corresponding tests