File writing example