Assignment-5 file handling