fix errors in pr10
useful error messages for file-related tasks

Error messages include content of input and output files
fix error in pr10
fix error