Basic code to read and write text to/from a file