Read and write files to a file.