Completed simple file reader and writer examples