open the file write the text close the file